aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2020-09-01 01:33:28 -0400
committerJoseph Hunkeler <jhunkeler@gmail.com>2020-09-01 01:33:28 -0400
commitc7aca5f09c81aa2455fed0ed73e15216dfa06857 (patch)
tree87afcc1ea930005c5216f91631045348b70e4c42
parent33187a7fed578c66559239d71b9164fb857aaa94 (diff)
downloadmultihome-c7aca5f09c81aa2455fed0ed73e15216dfa06857.tar.gz
Only call realpath when path is relative
-rw-r--r--multihome.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/multihome.c b/multihome.c
index 8ef736b..d6da415 100644
--- a/multihome.c
+++ b/multihome.c
@@ -255,9 +255,11 @@ void write_init_script() {
FILE *fp;
// Determine the absolute path of this program
- if (realpath(multihome.entry_point, buf) < 0) {
- perror(multihome.entry_point);
- exit(errno);
+ if (multihome.entry_point[0] != '/') {
+ if (realpath(multihome.entry_point, buf) < 0) {
+ perror(multihome.entry_point);
+ exit(errno);
+ }
}
// Open init script for writing