Stop leaking the state fd on reload.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Sun, 13 Apr 2014 20:33:19 +0000 (22:33 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Sun, 13 Apr 2014 20:33:19 +0000 (22:33 +0200)
main.cpp

index abc7617..28acd39 100644 (file)
--- a/main.cpp
+++ b/main.cpp
@@ -393,7 +393,7 @@ start:
        if (state_fd != -1) {
                log(INFO, "Deserializing state from previous process...");
                string serialized;
-               if (!read_tempfile(state_fd, &serialized)) {
+               if (!read_tempfile_and_close(state_fd, &serialized)) {
                        exit(1);
                }
                if (!loaded_state.ParseFromString(serialized)) {