diff options
author | Ian Fan <[email protected]> | 2018-12-09 12:09:11 +0000 |
---|---|---|
committer | Ian Fan <[email protected]> | 2019-01-01 09:01:25 +0000 |
commit | a82b8a3c14e45697708e57f8cb27a8fc6cf31839 (patch) | |
tree | 5e30327566fb6f30bd6d319f7b8a96226683e986 /common/util.c | |
parent | 967566e37f93890bd5255725129c929aeeac709e (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 |