| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: newfs_udf.c,v 1.9 2011/01/04 23:42:48 wiz Exp $ */ | | 1 | /* $NetBSD: newfs_udf.c,v 1.10 2011/01/21 22:10:51 reinoud Exp $ */ |
2 | | | 2 | |
3 | /* | | 3 | /* |
4 | * Copyright (c) 2006, 2008 Reinoud Zandijk | | 4 | * Copyright (c) 2006, 2008 Reinoud Zandijk |
5 | * All rights reserved. | | 5 | * All rights reserved. |
6 | * | | 6 | * |
7 | * Redistribution and use in source and binary forms, with or without | | 7 | * Redistribution and use in source and binary forms, with or without |
8 | * modification, are permitted provided that the following conditions | | 8 | * modification, are permitted provided that the following conditions |
9 | * are met: | | 9 | * are met: |
10 | * 1. Redistributions of source code must retain the above copyright | | 10 | * 1. Redistributions of source code must retain the above copyright |
11 | * notice, this list of conditions and the following disclaimer. | | 11 | * notice, this list of conditions and the following disclaimer. |
12 | * 2. Redistributions in binary form must reproduce the above copyright | | 12 | * 2. Redistributions in binary form must reproduce the above copyright |
13 | * notice, this list of conditions and the following disclaimer in the | | 13 | * notice, this list of conditions and the following disclaimer in the |
14 | * documentation and/or other materials provided with the distribution. | | 14 | * documentation and/or other materials provided with the distribution. |
| @@ -1539,27 +1539,27 @@ main(int argc, char **argv) | | | @@ -1539,27 +1539,27 @@ main(int argc, char **argv) |
1539 | /* open device */ | | 1539 | /* open device */ |
1540 | if ((fd = open(dev, O_RDWR, 0)) == -1) { | | 1540 | if ((fd = open(dev, O_RDWR, 0)) == -1) { |
1541 | perror("can't open device"); | | 1541 | perror("can't open device"); |
1542 | return EXIT_FAILURE; | | 1542 | return EXIT_FAILURE; |
1543 | } | | 1543 | } |
1544 | | | 1544 | |
1545 | /* stat the device */ | | 1545 | /* stat the device */ |
1546 | if (fstat(fd, &st) != 0) { | | 1546 | if (fstat(fd, &st) != 0) { |
1547 | perror("can't stat the device"); | | 1547 | perror("can't stat the device"); |
1548 | close(fd); | | 1548 | close(fd); |
1549 | return EXIT_FAILURE; | | 1549 | return EXIT_FAILURE; |
1550 | } | | 1550 | } |
1551 | | | 1551 | |
1552 | /* Formatting can only be done on raw devices */ | | 1552 | /* formatting can only be done on raw devices */ |
1553 | if (!S_ISCHR(st.st_mode)) { | | 1553 | if (!S_ISCHR(st.st_mode)) { |
1554 | printf("%s is not a raw device\n", dev); | | 1554 | printf("%s is not a raw device\n", dev); |
1555 | close(fd); | | 1555 | close(fd); |
1556 | return EXIT_FAILURE; | | 1556 | return EXIT_FAILURE; |
1557 | } | | 1557 | } |
1558 | | | 1558 | |
1559 | /* just in case something went wrong, synchronise the drive's cache */ | | 1559 | /* just in case something went wrong, synchronise the drive's cache */ |
1560 | udf_synchronise_caches(); | | 1560 | udf_synchronise_caches(); |
1561 | | | 1561 | |
1562 | /* get disc information */ | | 1562 | /* get disc information */ |
1563 | error = udf_update_discinfo(&mmc_discinfo); | | 1563 | error = udf_update_discinfo(&mmc_discinfo); |
1564 | if (error) { | | 1564 | if (error) { |
1565 | perror("can't retrieve discinfo"); | | 1565 | perror("can't retrieve discinfo"); |