summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2011-11-03 21:10:51 -0700
committerAlan Coopersmith <alan.coopersmith@oracle.com>2011-11-23 12:15:06 -0800
commitcccafabd56d0f8e5784ea0ad9fdc03224f952bfe (patch)
tree7c0370ec1734080c3a20f34a5a79935d6c9c09dc
parent3d0ece5e8467d823afb227b7a7f8b12b906b6ba9 (diff)
Mark arguments to fopen/popen/system wrappers as const char *
Silencing more gcc -Wwrite-strings warnings Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
-rw-r--r--include/os.h6
-rw-r--r--os/utils.c6
2 files changed, 6 insertions, 6 deletions
diff --git a/include/os.h b/include/os.h
index df3580521..22983814b 100644
--- a/include/os.h
+++ b/include/os.h
@@ -307,10 +307,10 @@ extern _X_EXPORT void OsReleaseSignals (void);
extern _X_EXPORT void OsAbort (void) _X_NORETURN;
#if !defined(WIN32)
-extern _X_EXPORT int System(char *);
-extern _X_EXPORT pointer Popen(char *, char *);
+extern _X_EXPORT int System(const char *);
+extern _X_EXPORT pointer Popen(const char *, const char *);
extern _X_EXPORT int Pclose(pointer);
-extern _X_EXPORT pointer Fopen(char *, char *);
+extern _X_EXPORT pointer Fopen(const char *, const char *);
extern _X_EXPORT int Fclose(pointer);
#else
#define System(a) system(a)
diff --git a/os/utils.c b/os/utils.c
index c828f01d9..b49fd3251 100644
--- a/os/utils.c
+++ b/os/utils.c
@@ -1252,7 +1252,7 @@ OsAbort (void)
*/
int
-System(char *command)
+System(const char *command)
{
int pid, p;
void (*csig)(int);
@@ -1302,7 +1302,7 @@ static struct pid {
OsSigHandlerPtr old_alarm = NULL; /* XXX horrible awful hack */
pointer
-Popen(char *command, char *type)
+Popen(const char *command, const char *type)
{
struct pid *cur;
FILE *iop;
@@ -1388,7 +1388,7 @@ Popen(char *command, char *type)
/* fopen that drops privileges */
pointer
-Fopen(char *file, char *type)
+Fopen(const char *file, const char *type)
{
FILE *iop;
#ifndef HAS_SAVED_IDS_AND_SETEUID