diff options
author | Alan Coopersmith <alan.coopersmith@sun.com> | 2008-10-22 08:37:59 -0700 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@sun.com> | 2008-10-22 08:37:59 -0700 |
commit | 01ac0b14bea486a626d8565dec8c8e546bb3d82f (patch) | |
tree | dd22f51f63fc7449d364f29e66d7fd87ad4ad719 /lock.c | |
parent | 6f1ebee7cba16f31c6201d6654d0c4ff9502ec12 (diff) |
Constify lock.c
Diffstat (limited to 'lock.c')
-rw-r--r-- | lock.c | 22 |
1 files changed, 11 insertions, 11 deletions
@@ -31,14 +31,14 @@ in this Software without prior written authorization from The Open Group. #include <sys/types.h> -static char * +static const char * GetPath(void) { - char *path = (char *) getenv ("SM_SAVE_DIR"); + const char *path = getenv ("SM_SAVE_DIR"); if (!path) { - path = (char *) getenv ("HOME"); + path = getenv ("HOME"); if (!path) path = "."; } @@ -48,9 +48,9 @@ GetPath(void) Status -LockSession(char *session_name, Bool write_id) +LockSession(const char *session_name, Bool write_id) { - char *path; + const char *path; char lock_file[PATH_MAX]; char temp_lock_file[PATH_MAX]; Status status; @@ -98,9 +98,9 @@ LockSession(char *session_name, Bool write_id) void -UnlockSession(char *session_name) +UnlockSession(const char *session_name) { - char *path; + const char *path; char lock_file[PATH_MAX]; path = GetPath (); @@ -113,9 +113,9 @@ UnlockSession(char *session_name) char * -GetLockId(char *session_name) +GetLockId(const char *session_name) { - char *path; + const char *path; FILE *fp; char lock_file[PATH_MAX]; char buf[256]; @@ -142,7 +142,7 @@ GetLockId(char *session_name) Bool -CheckSessionLocked(char *session_name, Bool get_id, char **id_ret) +CheckSessionLocked(const char *session_name, Bool get_id, char **id_ret) { if (get_id) *id_ret = GetLockId (session_name); @@ -156,7 +156,7 @@ CheckSessionLocked(char *session_name, Bool get_id, char **id_ret) void -UnableToLockSession(char *session_name) +UnableToLockSession(const char *session_name) { /* * We should popup a dialog here giving error. |