Show More
@@ -1,4 +1,4 b'' | |||||
1 | import os, stat |
|
1 | import os, stat, socket | |
2 | import re |
|
2 | import re | |
3 | import sys |
|
3 | import sys | |
4 | import tempfile |
|
4 | import tempfile | |
@@ -95,9 +95,17 b' def has_icasefs():' | |||||
95 | def has_inotify(): |
|
95 | def has_inotify(): | |
96 | try: |
|
96 | try: | |
97 | import hgext.inotify.linux.watcher |
|
97 | import hgext.inotify.linux.watcher | |
98 | return True |
|
|||
99 | except ImportError: |
|
98 | except ImportError: | |
100 | return False |
|
99 | return False | |
|
100 | name = tempfile.mktemp(dir='.', prefix=tempprefix) | |||
|
101 | sock = socket.socket(socket.AF_UNIX) | |||
|
102 | try: | |||
|
103 | sock.bind(name) | |||
|
104 | except socket.error, err: | |||
|
105 | return False | |||
|
106 | sock.close() | |||
|
107 | os.unlink(name) | |||
|
108 | return True | |||
101 |
|
109 | |||
102 | def has_fifo(): |
|
110 | def has_fifo(): | |
103 | if getattr(os, "mkfifo", None) is None: |
|
111 | if getattr(os, "mkfifo", None) is None: |
General Comments 0
You need to be logged in to leave comments.
Login now