Check /proc/self/exe instead of argv[0].
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Sun, 13 Apr 2014 19:31:09 +0000 (21:31 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Sun, 13 Apr 2014 19:31:09 +0000 (21:31 +0200)
main.cpp

index 6535da0..abc7617 100644 (file)
--- a/main.cpp
+++ b/main.cpp
@@ -338,7 +338,7 @@ int main(int argc, char **argv)
        char argv0_canon[PATH_MAX];
        char config_filename_canon[PATH_MAX];
 
-       if (realpath(argv[0], argv0_canon) == NULL) {
+       if (realpath("/proc/self/exe", argv0_canon) == NULL) {
                log_perror(argv[0]);
                exit(1);
        }