aboutsummaryrefslogtreecommitdiff
path: root/common/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'common/util.c')
-rw-r--r--common/util.c4
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