Commit f82c9a94 by Őry Máté

fix bugs in fix

parent a38e1fe0
......@@ -98,7 +98,7 @@ def notify(url):
os.environ["DISPLAY"] = olddisplay
def file_already_exists(name):
def file_already_exists(name, mode=0644):
"""Return whether file already exists, create it if not.
Other errors are silently ignored as the file will be reopened anyways.
......@@ -106,12 +106,12 @@ def file_already_exists(name):
"""
try:
fd = os_open(name, O_CREAT | O_EXCL)
fd = os.open(name, os.O_CREAT | os.O_EXCL, mode)
except OSError as e:
if e.errno == EEXIST:
if e.errno == os.EEXIST:
return True
else:
close(fd)
os.close(fd)
return False
......@@ -139,7 +139,6 @@ def search_display():
def main():
args = parse_arguments()
notify(args.url)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment