Add errno.h
[oweals/busybox.git] / mkfs_minix.c
index 15cf531f00c0a2be15f5792756d52c9dbb30ad59..e1ede6caa3357ba3c8ec4920aceb39498d5f7677 100644 (file)
@@ -262,7 +262,7 @@ static inline int bit(char * a,unsigned int i)
  */
 static volatile void die(char *str)
 {
-       errorMsg("%s\n", str);
+       error_msg("%s\n", str);
        exit(8);
 }
 
@@ -329,11 +329,8 @@ static int get_size(const char *file)
        int fd;
        long size;
 
-       fd = open(file, O_RDWR);
-       if (fd < 0) {
-               perror(file);
-               exit(1);
-       }
+       if ((fd = open(file, O_RDWR)) < 0)
+               perror_msg_and_die("%s", file);
        if (ioctl(fd, BLKGETSIZE, &size) >= 0) {
                close(fd);
                return (size * 512);
@@ -796,7 +793,7 @@ extern int mkfs_minix_main(int argc, char **argv)
 #ifdef BB_FEATURE_MINIX2
                                                version2 = 1;
 #else
-                                               errorMsg("%s: not compiled with minix v2 support\n",
+                                               error_msg("%s: not compiled with minix v2 support\n",
                                                                device_name);
                                                exit(-1);
 #endif