X-Git-Url: https://gapil.gnulinux.it/gitweb/?a=blobdiff_plain;f=sources%2Fgetcap.c;h=ad2e354e15281d415a7145b30baa648ac2c34c0d;hb=be93b54a4875d772cce5cbff77d32241039d0367;hp=ef26ace9364b02f0d2a4cdd46561d11437acfd06;hpb=ef5f7db093d49d85a8c35d4f6add85592155cc09;p=gapil.git diff --git a/sources/getcap.c b/sources/getcap.c index ef26ace..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 @@ -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; }