]> git.neil.brown.name Git - susman.git/blobdiff - lsused.c
wakealarmd: cope with delta between system time and RTC time.
[susman.git] / lsused.c
index e4d0f980b1536e983d1b5ce4ad6ef6d2d38a104c..cef9fe9ffb66db9af0626dcda2eeba127cb75dd3 100644 (file)
--- a/lsused.c
+++ b/lsused.c
@@ -8,7 +8,7 @@
  * shared lock on the suspend/disabled file and then read the event.
  *
  * The client opens connects on a unix domain socket to
- * /var/run/suspend/registration
+ * /run/suspend/registration
  * It sets 'W' with some fds attached to be watched.
  * On notification if any fds are readable we send by 'S' to say
  * Suspend Soon and wait for 'R' to say 'Ready'.
@@ -248,11 +248,13 @@ main(int argc, char *argv[])
 
        s = socket(AF_UNIX, SOCK_STREAM | SOCK_NONBLOCK|SOCK_CLOEXEC, 0);
        addr.sun_family = AF_UNIX;
-       strcpy(addr.sun_path, "/var/run/suspend/registration");
-       unlink("/var/run/suspend/registration");
+       strcpy(addr.sun_path, "/run/suspend/registration");
+       unlink("/run/suspend/registration");
        if (bind(s, (struct sockaddr *)&addr, sizeof(addr)) < 0)
                exit(1);
        listen(s, 20);
+       /* Incase someone is waiting for us... */
+       close(0);
 
        event_init();