projects
/
krsd
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
4d6e06d
)
tweak
author
Niklas Cathor
<nilclass@riseup.net>
Sun, 28 Jul 2013 20:42:19 +0000
(22:42 +0200)
committer
Niklas Cathor
<nilclass@riseup.net>
Sun, 28 Jul 2013 20:42:19 +0000
(22:42 +0200)
src/tools/remove-token.c
patch
|
blob
|
history
diff --git
a/src/tools/remove-token.c
b/src/tools/remove-token.c
index
128c917
..
4143b3f
100644
(file)
--- a/
src/tools/remove-token.c
+++ b/
src/tools/remove-token.c
@@
-10,11
+10,16
@@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#define _GNU_SOURCE
+
#include <stdio.h>
#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
#include <fcntl.h>
#include <errno.h>
#include <fcntl.h>
#include <errno.h>
+#include <string.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <stdint.h>
+#include <db.h>
#include "common/auth.h"
#include "common/auth.h"
@@
-31,9
+36,8
@@
int main(int argc, char **argv) {
struct rs_authorization auth;
auth.username = argv[1];
auth.token = argv[2];
struct rs_authorization auth;
auth.username = argv[1];
auth.token = argv[2];
- auth.scopes = NULL;
int success = remove_authorization(&auth);
close_authorizations();
int success = remove_authorization(&auth);
close_authorizations();
- fprintf(stderr, (success == 0) ? "Token removed.\n" : "Token not found!\n");
+ fprintf(stderr, (success == DB_NOTFOUND) ? "Token not found!\n" : (success == 0 ? "Token removed.\n" : "Error removing token!\n"));
return success;
}
return success;
}