X-Git-Url: https://gapil.gnulinux.it/gitweb/?p=gapil.git;a=blobdiff_plain;f=sources%2Fgetcap.c;h=ad2e354e15281d415a7145b30baa648ac2c34c0d;hp=349381279bae83cf67072bb52a57e9e628239937;hb=3f50b8e3fd683f710e34a88436109157d328e1b6;hpb=31f55ec58bee8b2c4993633849b7da4e30cab222 diff --git a/sources/getcap.c b/sources/getcap.c index 3493812..ad2e354 100644 --- a/sources/getcap.c +++ b/sources/getcap.c @@ -1,6 +1,6 @@ /* getcap.c * - * Copyright (C) 2006 Simone Piccardi + * Copyright (C) 2006-2012 Simone Piccardi * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -37,7 +37,7 @@ #include /* standard I/O library */ #include /* C strings library */ #include /* primitive system data types */ -#include +#include /* need package libcap-dev */ /* Help printing routine */ void usage(void); @@ -49,7 +49,7 @@ int main(int argc, char *argv[]) */ int i; pid_t pid = 0; - cap_t capab = NULL; + cap_t capab; char *string; int res; @@ -97,9 +97,8 @@ int main(int argc, char *argv[]) return 1; } } else { - capab = cap_init(); - res = capgetp(pid, capab); - if (res) { + capab = cap_get_pid(pid); + if (capab == NULL) { perror("cannot get process capabilities"); return 1; }