Print `undefined' if pathconf returns -1 without setting errno.
authordrepper <drepper>
Wed, 4 Mar 1998 17:13:35 +0000 (17:13 +0000)
committerdrepper <drepper>
Wed, 4 Mar 1998 17:13:35 +0000 (17:13 +0000)
posix/getconf.c

index 8aaa75b..4c3d917 100644 (file)
@@ -282,11 +282,17 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\
          case PATHCONF:
            if (argc < 3)
              usage ();
+           errno = 0;
            value = pathconf (argv[2], c->call_name);
            if (value == -1)
-             error (3, errno, "pathconf: %s", argv[2]);
-
-           printf ("%ld\n", value);
+             {
+               if (errno)
+                 error (3, errno, "pathconf: %s", argv[2]);
+               else
+                 puts (_("undefined"));
+             }
+           else
+             printf ("%ld\n", value);
            exit (0);
 
          case SYSCONF: