OpenBSD pledge support
This commit is contained in:
10
main.c
10
main.c
@@ -1,5 +1,8 @@
|
|||||||
#include "mpdws.h"
|
#include "mpdws.h"
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#ifdef __OpenBSD__
|
||||||
|
#include <unistd.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
struct mpd_ws_server server;
|
struct mpd_ws_server server;
|
||||||
@@ -14,6 +17,13 @@ int main() {
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef __OpenBSD__
|
||||||
|
if (pledge("inet stdio", NULL) == -1) {
|
||||||
|
perror("pledge");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Run main loop */
|
/* Run main loop */
|
||||||
mpd_ws_run(&server);
|
mpd_ws_run(&server);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user