No point in trying to update the -L file on loss of link if no -L has
authorkrw <krw@openbsd.org>
Mon, 19 May 2014 10:37:40 +0000 (10:37 +0000)
committerkrw <krw@openbsd.org>
Mon, 19 May 2014 10:37:40 +0000 (10:37 +0000)
been specified. Eliminates spurious "Couldn't write ''" log messages.

Spotted while looking into Roman Gorelov's logs on another problem.

sbin/dhclient/dhclient.c

index 250c71b..9699fba 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: dhclient.c,v 1.307 2014/05/18 15:17:50 krw Exp $      */
+/*     $OpenBSD: dhclient.c,v 1.308 2014/05/19 10:37:40 krw Exp $      */
 
 /*
  * Copyright 2004 Henning Brauer <henning@openbsd.org>
@@ -344,7 +344,7 @@ routehandler(void)
                        if (ifi->linkstat) {
                                client->state = S_REBOOTING;
                                state_reboot();
-                       } else {
+                       } else if (strlen(path_option_db)) {
                                /* Let monitoring programs see link loss. */
                                write_file(path_option_db,
                                    O_WRONLY | O_CREAT | O_TRUNC | O_SYNC |