diff options
| author | Furkan Sahin <furkan-dev@proton.me> | 2018-12-09 12:09:11 +0000 |
|---|---|---|
| committer | Furkan Sahin <furkan-dev@proton.me> | 2018-12-09 12:09:11 +0000 |
| commit | 29fb165c23f490d37760a580e2ab877c4dd9b2f0 (patch) | |
| tree | 5e30327566fb6f30bd6d319f7b8a96226683e986 /common/util.c | |
| parent | f55f6caca4ce8efb151ea059d78a9e049b5eaedb (diff) | |
Remove readline.c
All occurrences of read_line have been replaced by getline.
peek_line has been absorbed into detect_brace.
Diffstat (limited to 'common/util.c')
| -rw-r--r-- | common/util.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/common/util.c b/common/util.c index 40c64230..d66058a6 100644 --- a/common/util.c +++ b/common/util.c @@ -13,7 +13,6 @@ #include <xkbcommon/xkbcommon-names.h> #include <wlr/types/wlr_keyboard.h> #include "log.h" -#include "readline.h" #include "util.h" int wrap(int i, int max) { @@ -87,11 +86,12 @@ pid_t get_parent_pid(pid_t child) { char *token = NULL; const char *sep = " "; FILE *stat = NULL; + size_t buf_size = 0; sprintf(file_name, "/proc/%d/stat", child); if ((stat = fopen(file_name, "r"))) { - if ((buffer = read_line(stat))) { + if (getline(&buffer, &buf_size, stat) != -1) { token = strtok(buffer, sep); // pid token = strtok(NULL, sep); // executable name token = strtok(NULL, sep); // state |
