summaryrefslogtreecommitdiff
path: root/app/xsm/lock.c
diff options
context:
space:
mode:
authorMatthieu Herrb <matthieu@cvs.openbsd.org>2013-03-09 16:22:39 +0000
committerMatthieu Herrb <matthieu@cvs.openbsd.org>2013-03-09 16:22:39 +0000
commit0186d1252763bdcf11925666c74ff46f2ef2dc4b (patch)
tree99f98883fc1ede1bcf73f2e376b032eedd54217a /app/xsm/lock.c
parentbe97f8b2e5b933332ce52f8927c5e3f76f4c6fe9 (diff)
Upate to xsm 1.0.3
Diffstat (limited to 'app/xsm/lock.c')
-rw-r--r--app/xsm/lock.c11
1 files changed, 1 insertions, 10 deletions
diff --git a/app/xsm/lock.c b/app/xsm/lock.c
index 9a4553abb..84c0ee303 100644
--- a/app/xsm/lock.c
+++ b/app/xsm/lock.c
@@ -58,15 +58,10 @@ LockSession(const char *session_name, Bool write_id)
path = GetPath ();
-#ifndef __UNIXOS2__
snprintf (lock_file, sizeof(lock_file), "%s/.XSMlock-%s",
path, session_name);
snprintf (temp_lock_file, sizeof(temp_lock_file), "%s/.XSMtlock-%s",
path, session_name);
-#else
- snprintf (temp_lock_file, sizeof(temp_lock_file), "%s/%s.slk",
- path, session_name);
-#endif
if ((fd = creat (temp_lock_file, 0444)) < 0)
return (0);
@@ -81,7 +76,6 @@ LockSession(const char *session_name, Bool write_id)
close (fd);
-#ifndef __UNIXOS2__
status = 1;
if (link (temp_lock_file, lock_file) < 0)
@@ -89,9 +83,6 @@ LockSession(const char *session_name, Bool write_id)
if (remove (temp_lock_file) < 0)
status = 0;
-#else
- status = 0;
-#endif
return (status);
}
@@ -132,7 +123,7 @@ GetLockId(const char *session_name)
}
buf[0] = '\0';
- fscanf (fp, "%s\n", buf);
+ fscanf (fp, "%255s\n", buf);
ret = XtNewString (buf);
fclose (fp);