]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
secret: fix error check
authorJosh Durgin <josh.durgin@dreamhost.com>
Tue, 29 Nov 2011 00:52:19 +0000 (16:52 -0800)
committerJosh Durgin <josh.durgin@dreamhost.com>
Tue, 6 Dec 2011 18:26:24 +0000 (10:26 -0800)
add_key will return -1 when an error occurs, which should be handled at a higher level and not printed here.

Signed-off-by: Josh Durgin <josh.durgin@dreamhost.com>
src/common/secret.c

index b3caf9666735f037c4367102e881e969fcc1a935..fb37b6db74b8e406cddee498c41df04822222693 100644 (file)
@@ -66,10 +66,8 @@ static int add_secret_to_kernel(const char *secret, const char *key_name)
   }
 
   serial = add_key("ceph", key_name, payload, sizeof(payload), KEY_SPEC_USER_KEYRING);
-  if (serial < 0) {
+  if (serial == -1) {
     ret = -errno;
-    fprintf(stderr, "error adding secret to kernel, key name %s: %s.\n",
-           key_name, strerror_r(-ret, error_buf, sizeof(error_buf)));
   }
 
   return ret;