printenv: exit status is 2 on failure
This provides a reliable and portable way to test whether an environment variable is defined. (Of course, if you are using glibc you may get false positives if you include a = in the query.) Signed-off-by: Mattias Andrée <maandree@kth.se>
This commit is contained in:
@@ -26,5 +26,5 @@ main(int argc, char *argv[])
|
||||
}
|
||||
}
|
||||
|
||||
return fshut(stdout, "<stdout>") || ret;
|
||||
return fshut(stdout, "<stdout>") ? 2 : ret;
|
||||
}
|
||||
|
Reference in New Issue
Block a user