python socket_util: Use correct fatal_signal function on error path.
authorBen Pfaff <blp@nicira.com>
Wed, 7 Mar 2012 23:41:30 +0000 (15:41 -0800)
committerBen Pfaff <blp@nicira.com>
Thu, 8 Mar 2012 00:33:14 +0000 (16:33 -0800)
The correct function to call here is "remove_file_to_unlink".  That is,
since the file has already been unlinked there is no need to keep it on
the list of files to unlink.

However, "unlink_file_now" simplifies the code, so we might as well use
that.

Signed-off-by: Ben Pfaff <blp@nicira.com>
python/ovs/socket_util.py

index 0a26c5d..d00d398 100644 (file)
@@ -70,11 +70,7 @@ def make_unix_socket(style, nonblock, bind_path, connect_path):
     except socket.error, e:
         sock.close()
         if bind_path is not None:
-            try:
-                os.unlink(bind_path)
-            except OSError, e:
-                pass
-            ovs.fatal_signal.add_file_to_unlink(bind_path)
+            ovs.fatal_signal.unlink_file_now(bind_path)
         return get_exception_errno(e), None