Fix some "set but never used" warnings
authorVolker Lendecke <vl@samba.org>
Sun, 20 Jan 2008 16:35:25 +0000 (17:35 +0100)
committerVolker Lendecke <vl@samba.org>
Sun, 20 Jan 2008 16:44:40 +0000 (17:44 +0100)
(This used to be commit 4a6dadc5178f4861e9c032321939db3b639734b5)

source3/lib/dbwrap_tdb.c
source3/locking/brlock.c
source3/modules/vfs_streams_xattr.c
source3/registry/reg_api.c
source3/smbd/reply.c

index e87ceb428ffba5954ba58b75c487159832fa2527..18f94959315e4357e3cd032b81b1fcb08ccbc6e9 100644 (file)
@@ -91,7 +91,6 @@ static struct db_record *db_tdb_fetch_locked(struct db_context *db,
        struct db_tdb_ctx *ctx = talloc_get_type_abort(db->private_data,
                                                       struct db_tdb_ctx);
        struct tdb_fetch_locked_state state;
-       int res;
 
        /* Do not accidently allocate/deallocate w/o need when debug level is lower than needed */
        if(DEBUGLEVEL >= 10) {
@@ -110,8 +109,7 @@ static struct db_record *db_tdb_fetch_locked(struct db_context *db,
        state.mem_ctx = mem_ctx;
        state.result = NULL;
 
-       res = tdb_parse_record(ctx->wtdb->tdb, key, db_tdb_fetchlock_parse,
-                              &state);
+       tdb_parse_record(ctx->wtdb->tdb, key, db_tdb_fetchlock_parse, &state);
 
        if (state.result == NULL) {
                db_tdb_fetchlock_parse(key, tdb_null, &state);
index 4191871bb1a200bedf84b35075d663cb1eab1f01..341d00f3fe0aac5d0b77cedce5b83f88c43077d8 100644 (file)
@@ -1539,11 +1539,6 @@ int brl_forall(void (*fn)(struct file_id id, struct server_id pid,
 
 static int byte_range_lock_destructor(struct byte_range_lock *br_lck)
 {
-       TDB_DATA key;
-
-       key.dptr = (uint8 *)&br_lck->key;
-       key.dsize = sizeof(struct file_id);
-
        if (br_lck->read_only) {
                SMB_ASSERT(!br_lck->modified);
        }
index 87bcf22fb365db4b4e85bea74ff25e2587157e3f..7ce90ab30bec54ce7b0a7ca7e1aa35e56328638b 100644 (file)
@@ -618,6 +618,10 @@ static ssize_t streams_xattr_pwrite(vfs_handle_struct *handle,
 
        TALLOC_FREE(ea.value.data);
 
+       if (ret == -1) {
+               return -1;
+       }
+
        return n;
 }
 
index 788af28d5dd62bcdf33e58f3900b0e0d9c40a362..9c4009368d3b4f6f7e5fc1d07021dc5da443d23f 100644 (file)
@@ -453,7 +453,6 @@ WERROR reg_createkey(TALLOC_CTX *ctx, struct registry_key *parent,
        TALLOC_CTX *mem_ctx;
        char *path, *end;
        WERROR err;
-       REGSUBKEY_CTR *subkeys;
 
        if (!(mem_ctx = talloc_new(ctx))) return WERR_NOMEM;
 
@@ -517,11 +516,6 @@ WERROR reg_createkey(TALLOC_CTX *ctx, struct registry_key *parent,
         * Actually create the subkey
         */
 
-       if (!(subkeys = TALLOC_ZERO_P(mem_ctx, REGSUBKEY_CTR))) {
-               err = WERR_NOMEM;
-               goto done;
-       }
-
        err = fill_subkey_cache(create_parent);
        if (!W_ERROR_IS_OK(err)) goto done;
 
index 5a5eb1e190bb75d134fe00dd3bf136c992a064da..4ea81a3819053120ded61f8dcee8f08b5085afd9 100644 (file)
@@ -3375,7 +3375,6 @@ void error_to_writebrawerr(struct smb_request *req)
 void reply_writebraw(struct smb_request *req)
 {
        connection_struct *conn = req->conn;
-       int outsize = 0;
        char *buf = NULL;
        ssize_t nwritten=0;
        ssize_t total_written=0;
@@ -3485,8 +3484,7 @@ void reply_writebraw(struct smb_request *req)
         * it to send more bytes */
 
        memcpy(buf, req->inbuf, smb_size);
-       outsize = srv_set_message(buf,
-                       Protocol>PROTOCOL_COREPLUS?1:0,0,True);
+       srv_set_message(buf,Protocol>PROTOCOL_COREPLUS?1:0,0,True);
        SCVAL(buf,smb_com,SMBwritebraw);
        SSVALS(buf,smb_vwv0,0xFFFF);
        show_msg(buf);