Commit cdb783caf81b39f9e3c6fd1258209acfeb034bd9

Thomas de Grivel 2021-01-08T11:49:28

log early

diff --git a/git-auth.c b/git-auth.c
index 28fe475..ff7af2a 100644
--- a/git-auth.c
+++ b/git-auth.c
@@ -189,6 +189,8 @@ int main (int argc, char **argv)
         const char *git_auth_id;
         int auth_ok;
         const char *cmd_argv[3];
+        openlog(argv[0], LOG_PID, LOG_AUTH);
+        log_args("NEW", argc, (const char **) argv);
         if (argc != 4) {
                 fprintf(stderr, "git-auth: wrong number of arguments: %d.\n", argc);
                 usage(argv[0]);
@@ -202,8 +204,6 @@ int main (int argc, char **argv)
                 fprintf(stderr, "missing %s.\n", GIT_AUTH_ID_ENV);
                 usage(argv[0]);
         }
-        openlog(argv[0], LOG_PID, LOG_AUTH);
-        log_args("NEW", argc, (const char **) argv);
         cmd_argv[0] = git_auth_id;
         cmd_argv[1] = argv[2];
         cmd_argv[2] = argv[3];