]> git.ipfire.org Git - thirdparty/util-linux.git/blobdiff - login-utils/chfn.c
misc: consolidate version printing and close_stdout()
[thirdparty/util-linux.git] / login-utils / chfn.c
index c5312fa0c4750e8e2b5ecdc10724e1f3581e5c43..a2e6e099e0fce484586301b0af5016fbc1f35a0e 100644 (file)
@@ -176,8 +176,7 @@ static void parse_argv(struct chfn_control *ctl, int argc, char **argv)
                        status += check_gecos_string(_("Home Phone"), optarg);
                        break;
                case 'v':
-                       printf(UTIL_LINUX_VERSION);
-                       exit(EXIT_SUCCESS);
+                       print_version(EXIT_SUCCESS);
                case 'u':
                        usage();
                default:
@@ -412,7 +411,8 @@ int main(int argc, char **argv)
        setlocale(LC_ALL, "");  /* both for messages and for iscntrl() below */
        bindtextdomain(PACKAGE, LOCALEDIR);
        textdomain(PACKAGE);
-       atexit(close_stdout);
+       close_stdout_atexit();
+
        uid = getuid();
 
        /* check /etc/login.defs CHFN_RESTRICT */