From db356cc2b1127bb12b7adb096af2e251c2a68210 Mon Sep 17 00:00:00 2001 From: Zynh Ludwig Date: Sun, 24 Nov 2024 03:03:37 -0800 Subject: [PATCH] comment out post return --- selfrestart.c | 66 +++++++++++++++++++++++++-------------------------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/selfrestart.c b/selfrestart.c index 097d2ec..ca98d8c 100644 --- a/selfrestart.c +++ b/selfrestart.c @@ -25,39 +25,39 @@ char *get_dwm_path(){ return "/run/current-system/sw/bin/dwm"; // https://en.wikibooks.org/wiki/C_Programming/POSIX_Reference/sys/stat.h#Member_types - struct stat s; - int r, length, rate = 42; - char *path = NULL; - - if(lstat("/proc/self/exe", &s) == -1){ - perror("lstat:"); - return NULL; - } - - length = s.st_size + 1 - rate; - - do{ - length+=rate; - - free(path); - path = malloc(sizeof(char) * length); - - if(path == NULL){ - perror("malloc:"); - return NULL; - } - - r = readlink("/proc/self/exe", path, length); - - if(r == -1){ - perror("readlink:"); - return NULL; - } - }while(r >= length); - - path[r] = '\0'; - - return path; + // struct stat s; + // int r, length, rate = 42; + // char *path = NULL; + // + // if(lstat("/proc/self/exe", &s) == -1){ + // perror("lstat:"); + // return NULL; + // } + // + // length = s.st_size + 1 - rate; + // + // do{ + // length+=rate; + // + // free(path); + // path = malloc(sizeof(char) * length); + // + // if(path == NULL){ + // perror("malloc:"); + // return NULL; + // } + // + // r = readlink("/proc/self/exe", path, length); + // + // if(r == -1){ + // perror("readlink:"); + // return NULL; + // } + // }while(r >= length); + // + // path[r] = '\0'; + // + // return path; } /**