commit fa6854e34ce5d23dcd1762632a68520b9787e0c5 from: Caleb Stein date: Mon Jun 1 18:50:35 2026 UTC use setproctitle instead of overwriting argv[0] directly commit - ef197048827fd9c2a07aa6779ac3f90d3498bc6f commit + fa6854e34ce5d23dcd1762632a68520b9787e0c5 blob - 6583323eb3f3302da0ba1240c90a94a1aba4ed18 blob + d88a1e429c79a4fe86b55d0d4e52d4e20b54f6c6 --- include/statbar.h +++ include/statbar.h @@ -42,12 +42,12 @@ extern void normalize_clock_interval(const struct time /* Battery */ #define BATTERY_STRING_SIZE 11 -extern pid_t start_privileged_battery_process(int *pipe_fd, const struct timespec *timeout, char *prname); +extern pid_t start_privileged_battery_process(int *pipe_fd, const struct timespec *timeout); /* Volume */ #define VOLUME_STRING_SIZE 11 -extern pid_t start_volume_process(int *pipe_fd, char *prname); +extern pid_t start_volume_process(int *pipe_fd); /* CPU Temp */ extern char cputemp_string[14]; blob - c4b48683995918694d0a213703da1fc2a3cb2912 blob + 5ad180e72d57ba34465b017c24ab68c2a61fb160 --- modules/battery.c +++ modules/battery.c @@ -1,6 +1,6 @@ #include #include -#include +#include #include #include @@ -62,7 +62,7 @@ signal_handler(int sig) } pid_t -start_privileged_battery_process(int *pipe_fd, const struct timespec *timeout, char *prname) +start_privileged_battery_process(int *pipe_fd, const struct timespec *timeout) { pid_t pid; int batt_pipe[2]; @@ -86,7 +86,7 @@ start_privileged_battery_process(int *pipe_fd, const s if (init_battery() == -1) _exit(-1); (void)close(batt_pipe[0]); - (void)strcpy(prname, "sb-batt"); + setproctitle("battery"); (void)puts("Battery process started"); (void)signal(SIGTERM, signal_handler); blob - 4f9f0aac4768497625d90fe2f355a3f46939de20 blob + 3f60cc8cb3a9b95aa9b469b91a2d39b2e876bf36 --- modules/volume.c +++ modules/volume.c @@ -78,7 +78,7 @@ signal_handler(int sig) } pid_t -start_volume_process(int *pipe_fd, char *prname) +start_volume_process(int *pipe_fd) { pid_t pid; int vol_pipe[2]; @@ -112,7 +112,7 @@ start_volume_process(int *pipe_fd, char *prname) } if (init_volume(&nfds, &vol_pipe[1]) == -1) _exit(1); (void)close(vol_pipe[0]); - (void)strcpy(prname, "sb-vol"); + setproctitle("volume"); (void)puts("Volume process started"); (void)signal(SIGTERM, signal_handler); blob - b233b9b2a9cd1c7be54d4d58ad0955602d985fdc blob + 6b0755d6551bc2ec09f682358ebd2115cbbdc713 --- src/main.c +++ src/main.c @@ -70,7 +70,7 @@ install_signal_handlers(void) } int -main(int argc, char *argv[]) +main(void) { Display *display; Window root; @@ -103,7 +103,6 @@ main(int argc, char *argv[]) int i; ssize_t n; - (void)argc; (void)setvbuf(stdout, NULL, _IOLBF, 0); install_signal_handlers(); @@ -120,8 +119,8 @@ main(int argc, char *argv[]) timespecadd(&now, &weather_interval, &clocks[WEATHER_CLOCK]); get_clock(); - batt_pid = start_privileged_battery_process(&batt_fd, &battery_interval, argv[0]); - vol_pid = start_volume_process(&vol_fd, argv[0]); + batt_pid = start_privileged_battery_process(&batt_fd, &battery_interval); + vol_pid = start_volume_process(&vol_fd); get_cputemp(); get_fanspeed(); get_initial_network_state();