Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/client/client/intercept_exec.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ static int shouldPropogateSpindle(char **envp, const char *fname)
}

spindle = orig_getenv ? orig_getenv("SPINDLE") : getenv("SPINDLE");
if (spindle && (strcasecmp(spindle, "false") == 0 || strcmp("spindle", "0") == 0)) {
if (spindle && (strcasecmp(spindle, "false") == 0 || strcmp(spindle, "0") == 0)) {
debug_printf2("Not propogating spindle through exec because getenv(\"SPINDLE\") = %s\n", spindle);
return 0;
}
Expand Down
3 changes: 1 addition & 2 deletions src/client/client/lookup.c
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ int get_existance_test(int fd, const char *path, int *exists)
found_file = check_cache(path, "&", cache_name, dir_name, ENOENT, &errcode, &exist_str);
if (found_file) {
*exists = (exist_str && *exist_str == 'y');
spindle_free(exist_str);
spindle_free(exist_str); // malloc'd in check_cache
return 0;
}
}
Expand All @@ -226,7 +226,6 @@ int get_existance_test(int fd, const char *path, int *exists)
if (use_cache) {
exist_str = *exists ? "y" : "n";
update_cache(cache_name, dir_name, exist_str, &errcode, ENOENT);
spindle_free(exist_str);
}

return result;
Expand Down
1 change: 1 addition & 0 deletions src/client/shm_cache/shmcache.c
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,7 @@ static int shmcache_add_worker(const char *libname, const char *mapped_name, int
if (!mappedname_str) {
free_sheep_entry(entry);
free_sheep_str(libname_str);
return -1;
}
strncpy(mappedname_str, mapped_name, mappedname_len);
}
Expand Down
2 changes: 1 addition & 1 deletion src/fe/startup/jobtask.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class JobTask
}

~JobTask() {
if (app_argc & !noclean) {
if (app_argc && !noclean) {
for (int i = 0; i < app_argc; i++)
free(app_argv[i]);
free(app_argv);
Expand Down
2 changes: 1 addition & 1 deletion src/flux/flux-spindle.c
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ static int parse_yesno(opt_t *opt, opt_t flag, const char *yesno)
if (strcasecmp(yesno, "no") == 0 || strcasecmp(yesno, "false") == 0 || strcasecmp(yesno, "0") == 0)
*opt &= ~flag;
else if (strcasecmp(yesno, "yes") == 0 || strcasecmp(yesno, "true") == 0 || strcasecmp(yesno, "1") == 0)
*opt |= 1;
*opt |= flag;
else
logerrno_printf_and_return(1, "Error in spindle option: Expected 'yes' or 'no', got %s\n", yesno);
return 0;
Expand Down
4 changes: 2 additions & 2 deletions src/flux/procmgr.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ int init_readymsg()
int result, error;
result = pipe(ready_pipe);
if (result == -1) {
error = result;
error = errno;
fprintf(stderr, "Could not create ready pipe for spindle session: %s\n", strerror(error));
return -1;
}
Expand Down Expand Up @@ -216,7 +216,7 @@ static int read_pidfile(const char *name, const char *session_dir)

snprintf(session_path, sizeof(session_path), "%s/%s.pid", session_dir, name);
session_path[sizeof(session_path)-1] = '\0';
f = fopen(session_path, "w");
f = fopen(session_path, "r");
if (!f) {
error = errno;
fprintf(stderr, "Error reading pid file for spindle service at %s: %s\n", session_path, strerror(error));
Expand Down
2 changes: 1 addition & 1 deletion src/server/auditserver/msgbundle.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ static void *thrd_main(void *timeout)
do {
debug_printf2("Triggering message buffer cache flush due to timeout\n");
result = write(flush_pipe[1], "f", 1);
} while (result == EINTR);
} while (result == -1 && errno == EINTR);

pthread_mutex_lock(&mut);
active_timeout = 0;
Expand Down
5 changes: 2 additions & 3 deletions src/server/auditserver/translate_maps.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ static int open_replacement_proc_maps(char *spindle_dir, int pid, char *output_f
static int uniqnum = 0;

snprintf(output_file, output_file_size, "%s/spindle_proc_maps_%d_%d", spindle_dir, pid, uniqnum++);
output_file[MAX_NAME_LEN] = '\0';
fd = open(output_file, O_WRONLY | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR);
if (fd == -1) {
error = errno;
Expand Down Expand Up @@ -160,7 +159,7 @@ static int translate_line(char *spindle_dir, char *line, int *linelen, int maxle
lastpart = spindle_dir;
if (*(lastpart+1) == '\0') {
lastpart--;
while (lastpart != line && *lastpart != '/') lastpart--;
while (lastpart != spindle_dir && *lastpart != '/') lastpart--;
}

p = strstr(line, lastpart);
Expand Down Expand Up @@ -199,7 +198,7 @@ int translate_proc_pid_maps(char *spindle_dir, int pid, char *output_file, int o
}

newfd = open_replacement_proc_maps(spindle_dir, pid, output_file, output_file_size);
if (fd == -1) {
if (newfd == -1) {
close(fd);
return -1;
}
Expand Down
2 changes: 1 addition & 1 deletion src/utils/exitnote.c
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ int pingExitNote(const char *location)
done:
if (socketpath)
free(socketpath);
if (sockfd)
if (sockfd != -1)
close(sockfd);

return presult;
Expand Down
1 change: 1 addition & 0 deletions src/utils/handle_vararg.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
errno = ENOMEM; \
return -1; \
} \
argv = newp; \
} \
} \
\
Expand Down
Loading