Change in mncc-python[master]: MnccSocketServer: Don't unlink if the socket doesn't exist

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

laforge gerrit-no-reply at lists.osmocom.org
Fri Mar 6 17:54:21 UTC 2020


laforge has submitted this change. ( https://gerrit.osmocom.org/c/mncc-python/+/17396 )

Change subject: MnccSocketServer: Don't unlink if the socket doesn't exist
......................................................................

MnccSocketServer: Don't unlink if the socket doesn't exist

Change-Id: I5164502f2d20d5e82e916918ad8556c2b5f7a3d1
---
M mncc_sock.py
1 file changed, 2 insertions(+), 1 deletion(-)

Approvals:
  laforge: Verified
  fixeria: Looks good to me, approved



diff --git a/mncc_sock.py b/mncc_sock.py
index 009a476..b2d0705 100644
--- a/mncc_sock.py
+++ b/mncc_sock.py
@@ -154,7 +154,8 @@
 
 class MnccSocketServer(object):
     def __init__(self, address = '/tmp/bsc_mncc'):
-        os.unlink(address)
+        if os.path.exists(address):
+            os.unlink(address)
         self.sock = socket.socket(socket.AF_UNIX, socket.SOCK_SEQPACKET)
         self.sock.bind(address)
         self.sock.listen(5)

-- 
To view, visit https://gerrit.osmocom.org/c/mncc-python/+/17396
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: mncc-python
Gerrit-Branch: master
Gerrit-Change-Id: I5164502f2d20d5e82e916918ad8556c2b5f7a3d1
Gerrit-Change-Number: 17396
Gerrit-PatchSet: 2
Gerrit-Owner: laforge <laforge at osmocom.org>
Gerrit-Reviewer: fixeria <axilirator at gmail.com>
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200306/57ecd5b5/attachment.htm>


More information about the gerrit-log mailing list