X-Git-Url: https://git.danieliu.xyz/?p=surf.git;a=blobdiff_plain;f=surf.c;h=29b9edef0f287035c0f4ca7486e5b2d7cf76ed19;hp=7e2b2bd2c14e1b0e8dc6b686871ebcc35ddb065a;hb=c64c368d86a4319e43b7ff3d73a4afe0f4e8adf0;hpb=4c41d363b761999a8af864b4e20218f0625d940f diff --git a/surf.c b/surf.c index 7e2b2bd..29b9ede 100644 --- a/surf.c +++ b/surf.c @@ -145,6 +145,7 @@ static void usage(void); static void die(const char *errstr, ...); static void setup(void); static void sigchld(int unused); +static void sighup(int unused); static char *buildfile(const char *path); static char *buildpath(const char *path); static const char *getuserhomedir(const char *user); @@ -266,6 +267,9 @@ setup(void) /* clean up any zombies immediately */ sigchld(0); + if (signal(SIGHUP, sighup) == SIG_ERR) + die("Can't install SIGHUP handler"); + gtk_init(NULL, NULL); gdpy = gdk_display_get_default(); @@ -331,6 +335,16 @@ sigchld(int unused) ; } +void +sighup(int unused) +{ + Arg a = { .b = 0 }; + Client *c; + + for (c = clients; c; c = c->next) + reload(c, &a); +} + char * buildfile(const char *path) {