From: Ben Pfaff Date: Wed, 11 Mar 2009 21:23:15 +0000 (-0700) Subject: cfg: Initialize lock_fd to -1. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=00034713a99b1fbc353699fe779360960eeca6a6;p=openvswitch cfg: Initialize lock_fd to -1. Otherwise cfg_unlock() will close stdin on the first call. Since create_lockfile() calls remove_lockfile() as its first action, that's on every useful execution. --- diff --git a/lib/cfg.c b/lib/cfg.c index 559b8a69..29bc495b 100644 --- a/lib/cfg.c +++ b/lib/cfg.c @@ -61,7 +61,7 @@ static char *tmp_name; /* Lock information. */ static char *lock_name; -int lock_fd; +int lock_fd = -1; /* Flag to indicate whether local modifications have been made. */ bool dirty;