projects
/
gapil.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Aggiornamento note copyright e I/O Asyncrono
[gapil.git]
/
sources
/
getcap.c
diff --git
a/sources/getcap.c
b/sources/getcap.c
index 19974eebdb559e73c6b6385e0935bdb9ed1f644f..ad2e354e15281d415a7145b30baa648ac2c34c0d 100644
(file)
--- a/
sources/getcap.c
+++ b/
sources/getcap.c
@@
-1,6
+1,6
@@
/* getcap.c
*
/* 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
*
* 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
@@
-26,7
+26,6
@@
*
* Usage: getcap -h give all info's
*
*
* Usage: getcap -h give all info's
*
- *
****************************************************************/
/*
* Include needed headers
****************************************************************/
/*
* Include needed headers
@@
-36,9
+35,9
@@
#include <stdlib.h> /* C standard library */
#include <unistd.h> /* unix standard library */
#include <stdio.h> /* standard I/O library */
#include <stdlib.h> /* C standard library */
#include <unistd.h> /* unix standard library */
#include <stdio.h> /* standard I/O library */
-#include <string.h> /*
string functions
*/
-#include <sys/types.h>
-#include <sys/capability.h>
+#include <string.h> /*
C strings library
*/
+#include <sys/types.h>
/* primitive system data types */
+#include <sys/capability.h>
/* need package libcap-dev */
/* Help printing routine */
void usage(void);
/* Help printing routine */
void usage(void);
@@
-50,7
+49,7
@@
int main(int argc, char *argv[])
*/
int i;
pid_t pid = 0;
*/
int i;
pid_t pid = 0;
- cap_t capab
= NULL
;
+ cap_t capab;
char *string;
int res;
char *string;
int res;
@@
-98,9
+97,8
@@
int main(int argc, char *argv[])
return 1;
}
} else {
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;
}
perror("cannot get process capabilities");
return 1;
}