Deleted Added
full compact
nand_readoob.c (302408) nand_readoob.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_readoob.c 235537 2012-05-17 10:11:18Z gber $");
28__FBSDID("$FreeBSD: stable/11/usr.sbin/nandtool/nand_readoob.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/types.h>
36#include <sys/disk.h>

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

52 }
53
54 if (!(dev = param_get_string(params, "dev"))) {
55 fprintf(stderr, "You must supply 'dev' argument.\n");
56 return (1);
57 }
58
59 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/types.h>
36#include <sys/disk.h>

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

52 }
53
54 if (!(dev = param_get_string(params, "dev"))) {
55 fprintf(stderr, "You must supply 'dev' argument.\n");
56 return (1);
57 }
58
59 if ((out = param_get_string(params, "out"))) {
60 if ((fd_out = open(out, O_WRONLY | O_CREAT)) == -1) {
60 if ((fd_out = open(out, O_WRONLY | O_CREAT, 0666)) == -1) {
61 perrorf("Cannot open %s", out);
62 ret = 1;
63 goto out;
64 }
65 }
66
67 if ((fd = g_open(dev, 1)) == -1) {
68 perrorf("Cannot open %s", dev);

--- 43 unchanged lines hidden ---
61 perrorf("Cannot open %s", out);
62 ret = 1;
63 goto out;
64 }
65 }
66
67 if ((fd = g_open(dev, 1)) == -1) {
68 perrorf("Cannot open %s", dev);

--- 43 unchanged lines hidden ---