]> code.citadel.org Git - citadel.git/commitdiff
If /etc/inittab is not found, return quietly instead of
authorArt Cancro <ajc@citadel.org>
Tue, 19 Dec 2006 14:23:34 +0000 (14:23 +0000)
committerArt Cancro <ajc@citadel.org>
Tue, 19 Dec 2006 14:23:34 +0000 (14:23 +0000)
displaying a scary error message.  FreeBSD, Mac OS, and the newest
version of Ubuntu do not have this file.

citadel/setup.c

index 54474cd64239669fb3dbb167277e1462dbf6324f..114323eeab3fc18fc7bdd73d61b2ffa10671ae32 100644 (file)
@@ -404,6 +404,16 @@ void delete_inittab_entry(void)
        /* Now tweak /etc/inittab */
        infp = fopen("/etc/inittab", "r");
        if (infp == NULL) {
+
+               /* If /etc/inittab does not exist, return quietly.
+                * Not all host platforms have it.
+                */
+               if (errno == ENOENT) {
+                       return;
+               }
+
+               /* Other errors might mean something really did go wrong.
+                */
                sprintf(buf, "Cannot open /etc/inittab: %s", strerror(errno));
                display_error(buf);
                return;