commit - ef197048827fd9c2a07aa6779ac3f90d3498bc6f
commit + fa6854e34ce5d23dcd1762632a68520b9787e0c5
blob - 6583323eb3f3302da0ba1240c90a94a1aba4ed18
blob + d88a1e429c79a4fe86b55d0d4e52d4e20b54f6c6
--- include/statbar.h
+++ include/statbar.h
/* 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
#include <stdbool.h>
#include <stdio.h>
-#include <string.h>
+#include <stdlib.h>
#include <fcntl.h>
#include <signal.h>
}
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];
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
}
pid_t
-start_volume_process(int *pipe_fd, char *prname)
+start_volume_process(int *pipe_fd)
{
pid_t pid;
int vol_pipe[2];
}
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
}
int
-main(int argc, char *argv[])
+main(void)
{
Display *display;
Window root;
int i;
ssize_t n;
- (void)argc;
(void)setvbuf(stdout, NULL, _IOLBF, 0);
install_signal_handlers();
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();