diff --git a/src/login.c b/src/login.c index 9fe9b3a..dc6cdf7 100644 --- a/src/login.c +++ b/src/login.c @@ -370,7 +370,7 @@ const char* de_command, enum deserv_t display_server) break; } - exit(0); + exit(EXIT_SUCCESS); } /* waits for the de/shell to exit */ @@ -477,7 +477,7 @@ int xinitrc) if(child == 0) { execl(pwd->pw_shell, pwd->pw_shell, "-c", cmd, NULL); - exit(0); + exit(EXIT_SUCCESS); } waitpid(child, &status, 0); @@ -489,7 +489,7 @@ int xinitrc) de_command, LY_CMD_X, display_name, vt, getenv("XAUTHORITY")); execve(pwd->pw_shell, argv, environ); - exit(0); + exit(EXIT_SUCCESS); } void launch_wayland(struct passwd* pwd, pam_handle_t* pam_handle, @@ -507,7 +507,7 @@ void launch_shell(struct passwd* pwd, pam_handle_t* pam_handle) strncpy(args + 1, ((pos = strrchr(pwd->pw_shell, '/')) ? pos + 1 : pwd->pw_shell), sizeof(args) - 1); execl(pwd->pw_shell, args, NULL); - exit(0); + exit(EXIT_SUCCESS); } void destroy_env(void) @@ -594,7 +594,7 @@ void reset_terminal(struct passwd* pwd) if(pid == 0) { execl(pwd->pw_shell, pwd->pw_shell, "-c", cmd, NULL); - exit(0); + exit(EXIT_SUCCESS); } waitpid(pid, &status, 0); diff --git a/src/main.c b/src/main.c index ff34556..5ce9f0c 100644 --- a/src/main.c +++ b/src/main.c @@ -60,7 +60,7 @@ int main(void) { fprintf(stderr, "%s\n", LY_ERR_FD_CONSOLE); fprintf(stderr, "%s\n", LY_ERR_FD_CONSOLE_ADVICE); - return 0; + return EXIT_FAILURE; } /* create LY_CFG_SAVE if it doesn't exist yet */ @@ -68,7 +68,7 @@ int main(void) if (!cfg_save) { fprintf(stderr, "%s: %s\n", LY_ERR_FD_CFG_SAVE, LY_CFG_SAVE); - return 0; + return EXIT_FAILURE; } fclose(cfg_save); @@ -217,5 +217,5 @@ int main(void) free_list(de_list); end_form(&form); endwin(); - return 0; + return EXIT_SUCCESS; } diff --git a/src/utils.c b/src/utils.c index 9214db7..1f6393f 100644 --- a/src/utils.c +++ b/src/utils.c @@ -22,7 +22,7 @@ void kernel_log(int mode) pid = fork(); if(pid < 0) { perror("fork"); - exit(1); + exit(EXIT_FAILURE); } if(pid == 0) @@ -37,12 +37,12 @@ void kernel_log(int mode) } /* execl should not return */ perror("execl"); - exit(1); + exit(EXIT_FAILURE); } waitpid(pid, &status, 0); if(!WIFEXITED(status) || WEXITSTATUS(status)) - exit(1); + exit(EXIT_FAILURE); } char* trim(char* s)