about summary refs log tree commit diff
path: root/posix
diff options
context:
space:
mode:
Diffstat (limited to 'posix')
-rw-r--r--posix/getconf.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/posix/getconf.c b/posix/getconf.c
index 8aaa75ba67..4c3d9174ba 100644
--- a/posix/getconf.c
+++ b/posix/getconf.c
@@ -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: