]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
mkswap: use EXIT_ values
authorSami Kerola <kerolasa@iki.fi>
Sat, 19 Feb 2011 23:00:39 +0000 (00:00 +0100)
committerKarel Zak <kzak@redhat.com>
Mon, 21 Feb 2011 15:12:48 +0000 (16:12 +0100)
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
disk-utils/mkswap.c

index 2e11f74efca7b6c48d9551bfe41fc86166d79d29..4a171dba76c4d31499df5f4fc8992bfe05277c63 100644 (file)
@@ -333,7 +333,7 @@ get_size(const char  *file) {
        fd = open(file, O_RDONLY);
        if (fd < 0) {
                perror(file);
-               exit(1);
+               exit(EXIT_FAILURE);
        }
        if (blkdev_get_size(fd, &size) == 0)
                size /= pagesize;
@@ -571,7 +571,7 @@ main(int argc, char ** argv) {
 
        if (stat(device_name, &statbuf) < 0) {
                perror(device_name);
-               exit(1);
+               exit(EXIT_FAILURE);
        }
        if (S_ISBLK(statbuf.st_mode))
                DEV = open(device_name, O_RDWR | O_EXCL);
@@ -580,7 +580,7 @@ main(int argc, char ** argv) {
 
        if (DEV < 0) {
                perror(device_name);
-               exit(1);
+               exit(EXIT_FAILURE);
        }
 
        /* Want a block device. Probably not /dev/hda or /dev/hdb. */
@@ -663,5 +663,5 @@ main(int argc, char ** argv) {
                freecon(oldcontext);
        }
 #endif
-       return 0;
+       return EXIT_SUCCESS;
 }