]> git.ipfire.org Git - thirdparty/util-linux.git/blobdiff - login-utils/islocal.c
scriptreplay: cleanup usage()
[thirdparty/util-linux.git] / login-utils / islocal.c
index 13ce28e481962fb58fb5d0a5525ab9dd6a58ee7c..469bc5629de222caf1d047ecc3402a4c77009823 100644 (file)
@@ -82,19 +82,16 @@ static int is_local_in_file(const char *user, const char *filename)
 int is_local(const char *user)
 {
        int rv;
-       if ((rv = is_local_in_file(user, _PATH_PASSWD)) < 0) {
-               perror(_PATH_PASSWD);
-               fprintf(stderr, _("cannot open %s"), _PATH_PASSWD);
-               exit(1);
-       } else {
-               return rv;
-       }
+
+       if ((rv = is_local_in_file(user, _PATH_PASSWD)) < 0)
+               err(EXIT_FAILURE, _("cannot open %s"), _PATH_PASSWD);
+       return rv;
 }
 
 #ifdef TEST_PROGRAM
 int main(int argc, char *argv[])
 {
-       atexit(close_stdout);
+       close_stdout_atexit();
        if (argc <= 2) {
                fprintf(stderr, _("Usage: %s <passwordfile> <username>...\n"),
                        argv[0]);