-/* $OpenBSD: apm.c,v 1.33 2017/07/23 12:51:20 anton Exp $ */
+/* $OpenBSD: apm.c,v 1.34 2018/08/14 06:38:33 mestre Exp $ */
/*
* Copyright (c) 1996 John T. Kohl
fd = open_socket(sockname);
if (fd != -1) {
- if (pledge("stdio rpath wpath cpath", NULL) == -1)
+ if (pledge("stdio", NULL) == -1)
err(1, "pledge");
}
/* open the device directly and get status */
fd = open(_PATH_APM_NORMAL, O_RDONLY);
if (ioctl(fd, APM_IOC_GETPOWER,
- &reply.batterystate) == 0)
+ &reply.batterystate) == 0) {
+ if (pledge("stdio", NULL) == -1)
+ err(1, "pledge");
+
goto printval;
+ }
}
/* FALLTHROUGH */
balony: