diff options
| author | Junio C Hamano <gitster@pobox.com> | 2022-05-02 10:06:00 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2022-05-02 10:06:04 -0700 |
| commit | 2b0a58d164b0642be3eeb476fecd28114445cdd5 (patch) | |
| tree | 2759549fcdd5d3ce4c9776f67937b4b75c07070f /builtin/gc.c | |
| parent | d516b2db0af2221bd6b13e7347abdcb5830b2829 (diff) | |
| parent | afe8a9070bc62db9cfde1e30147178c40d391d93 (diff) | |
| download | git-2b0a58d164b0642be3eeb476fecd28114445cdd5.tar.xz | |
Merge branch 'ep/maint-equals-null-cocci' for maint-2.35
* ep/maint-equals-null-cocci:
tree-wide: apply equals-null.cocci
contrib/coccinnelle: add equals-null.cocci
Diffstat (limited to 'builtin/gc.c')
| -rw-r--r-- | builtin/gc.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/builtin/gc.c b/builtin/gc.c index 8e60ef1eab..3531d667cb 100644 --- a/builtin/gc.c +++ b/builtin/gc.c @@ -446,7 +446,7 @@ static const char *lock_repo_for_gc(int force, pid_t* ret_pid) fscanf(fp, scan_fmt, &pid, locking_host) == 2 && /* be gentle to concurrent "gc" on remote hosts */ (strcmp(locking_host, my_host) || !kill(pid, 0) || errno == EPERM); - if (fp != NULL) + if (fp) fclose(fp); if (should_exit) { if (fd >= 0) @@ -2238,7 +2238,7 @@ static int systemd_timer_write_unit_templates(const char *exec_path) goto error; } file = fopen_or_warn(filename, "w"); - if (file == NULL) + if (!file) goto error; unit = "# This file was created and is maintained by Git.\n" @@ -2267,7 +2267,7 @@ static int systemd_timer_write_unit_templates(const char *exec_path) filename = xdg_config_home_systemd("git-maintenance@.service"); file = fopen_or_warn(filename, "w"); - if (file == NULL) + if (!file) goto error; unit = "# This file was created and is maintained by Git.\n" |
