Use negative_errno() to assert errno is positive after a few system calls
This is not particularly intrusive because it happens in simple utility functions. It helps gcc understand that error codes are negative. This gets a rid of most of the remaining warnings.
This commit is contained in:
@@ -102,7 +102,7 @@ int path_make_absolute_cwd(const char *p, char **ret) {
|
||||
|
||||
cwd = get_current_dir_name();
|
||||
if (!cwd)
|
||||
return -errno;
|
||||
return negative_errno();
|
||||
|
||||
c = strjoin(cwd, "/", p, NULL);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user