Deleted Added
full compact
nand_read.c (302408) nand_read.c (327652)
1/*-
2 * Copyright (c) 2010-2012 Semihalf.
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 11 unchanged lines hidden (view full) ---

20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 */
26
27#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2010-2012 Semihalf.
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 11 unchanged lines hidden (view full) ---

20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 */
26
27#include <sys/cdefs.h>
28__FBSDID("$FreeBSD: stable/11/usr.sbin/nandtool/nand_read.c 235537 2012-05-17 10:11:18Z gber $");
28__FBSDID("$FreeBSD: stable/11/usr.sbin/nandtool/nand_read.c 327652 2018-01-06 22:59:10Z jilles $");
29
30#include <stdio.h>
31#include <stdlib.h>
32#include <unistd.h>
33#include <fcntl.h>
34#include <libgeom.h>
35#include <sys/disk.h>
36#include <dev/nand/nand_dev.h>

--- 8 unchanged lines hidden (view full) ---

45 uint8_t *buf = NULL;
46
47 if (!(dev = param_get_string(params, "dev"))) {
48 fprintf(stderr, "You must specify 'dev' parameter\n");
49 return (1);
50 }
51
52 if ((out = param_get_string(params, "out"))) {
29
30#include <stdio.h>
31#include <stdlib.h>
32#include <unistd.h>
33#include <fcntl.h>
34#include <libgeom.h>
35#include <sys/disk.h>
36#include <dev/nand/nand_dev.h>

--- 8 unchanged lines hidden (view full) ---

45 uint8_t *buf = NULL;
46
47 if (!(dev = param_get_string(params, "dev"))) {
48 fprintf(stderr, "You must specify 'dev' parameter\n");
49 return (1);
50 }
51
52 if ((out = param_get_string(params, "out"))) {
53 out_fd = open(out, O_WRONLY|O_CREAT);
53 out_fd = open(out, O_WRONLY|O_CREAT, 0666);
54 if (out_fd == -1) {
55 perrorf("Cannot open %s for writing", out);
56 return (1);
57 }
58 }
59
60 if ((fd = g_open(dev, 1)) == -1) {
61 perrorf("Cannot open %s", dev);

--- 78 unchanged lines hidden ---
54 if (out_fd == -1) {
55 perrorf("Cannot open %s for writing", out);
56 return (1);
57 }
58 }
59
60 if ((fd = g_open(dev, 1)) == -1) {
61 perrorf("Cannot open %s", dev);

--- 78 unchanged lines hidden ---