summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Klauser <tklauser@distanz.ch>2013-07-31 09:44:55 +0200
committerTobias Klauser <tklauser@distanz.ch>2013-07-31 09:44:55 +0200
commit18a5634766fa520d1160babc26bf8159877e127c (patch)
treefc1244b17c55fb2292b3e20c2e45339427be730b
parent514a4ae9fa544db72e3ea2fc6dcd3a9530b24127 (diff)
ioops: Constify `name' parameter to tun_open_or_die()
The parameter `name' to tun_open_or_die() is never modified inside the function, thus mark it as const. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
-rw-r--r--ioops.c2
-rw-r--r--ioops.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/ioops.c b/ioops.c
index 07cce9c..e2b9136 100644
--- a/ioops.c
+++ b/ioops.c
@@ -58,7 +58,7 @@ void pipe_or_die(int pipefd[2], int flags)
panic("Cannot create pipe2 event fd! %s.\n", strerror(errno));
}
-int tun_open_or_die(char *name, int type)
+int tun_open_or_die(const char *name, int type)
{
int fd, ret;
short flags;
diff --git a/ioops.h b/ioops.h
index 8e12448..ce0315f 100644
--- a/ioops.h
+++ b/ioops.h
@@ -8,7 +8,7 @@ extern int open_or_die_m(const char *file, int flags, mode_t mode);
extern int dup_or_die(int oldfd);
extern void dup2_or_die(int oldfd, int newfd);
extern void create_or_die(const char *file, mode_t mode);
-extern int tun_open_or_die(char *name, int type);
+extern int tun_open_or_die(const char *name, int type);
extern void pipe_or_die(int pipefd[2], int flags);
extern ssize_t read_or_die(int fd, void *buf, size_t count);
extern ssize_t write_or_die(int fd, const void *buf, size_t count);