summaryrefslogtreecommitdiff
path: root/compat/mingw.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2022-05-20 15:26:59 -0700
committerJunio C Hamano <gitster@pobox.com>2022-05-20 15:26:59 -0700
commit538dc459a0331c48b893c9f6ca0be5917860bb99 (patch)
treed8b7cf10c62573f767116c14f7ffd0d9e1d8ec32 /compat/mingw.c
parentacdeb10f91da939135fbacb847792ae237450d7d (diff)
parent72a4ea71e5f29e4078363e87e4471128ff713a62 (diff)
downloadgit-538dc459a0331c48b893c9f6ca0be5917860bb99.tar.gz
Merge branch 'ep/maint-equals-null-cocci'
Introduce and apply coccinelle rule to discourage an explicit comparison between a pointer and NULL, and applies the clean-up to the maintenance track. * ep/maint-equals-null-cocci: tree-wide: apply equals-null.cocci tree-wide: apply equals-null.cocci contrib/coccinnelle: add equals-null.cocci
Diffstat (limited to 'compat/mingw.c')
-rw-r--r--compat/mingw.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/compat/mingw.c b/compat/mingw.c
index 6fe80fdf01..5772692a0a 100644
--- a/compat/mingw.c
+++ b/compat/mingw.c
@@ -1060,7 +1060,7 @@ char *mingw_mktemp(char *template)
int mkstemp(char *template)
{
char *filename = mktemp(template);
- if (filename == NULL)
+ if (!filename)
return -1;
return open(filename, O_RDWR | O_CREAT, 0600);
}
@@ -2332,7 +2332,7 @@ int setitimer(int type, struct itimerval *in, struct itimerval *out)
static const struct timeval zero;
static int atexit_done;
- if (out != NULL)
+ if (out)
return errno = EINVAL,
error("setitimer param 3 != NULL not implemented");
if (!is_timeval_eq(&in->it_interval, &zero) &&
@@ -2361,7 +2361,7 @@ int sigaction(int sig, struct sigaction *in, struct sigaction *out)
if (sig != SIGALRM)
return errno = EINVAL,
error("sigaction only implemented for SIGALRM");
- if (out != NULL)
+ if (out)
return errno = EINVAL,
error("sigaction: param 3 != NULL not implemented");