summaryrefslogtreecommitdiff
path: root/lock.c
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@sun.com>2008-10-22 08:37:59 -0700
committerAlan Coopersmith <alan.coopersmith@sun.com>2008-10-22 08:37:59 -0700
commit01ac0b14bea486a626d8565dec8c8e546bb3d82f (patch)
treedd22f51f63fc7449d364f29e66d7fd87ad4ad719 /lock.c
parent6f1ebee7cba16f31c6201d6654d0c4ff9502ec12 (diff)
Constify lock.c
Diffstat (limited to 'lock.c')
-rw-r--r--lock.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/lock.c b/lock.c
index 3170458..9a4553a 100644
--- a/lock.c
+++ b/lock.c
@@ -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.