From 07e0094365e8dc360a83eec2e7cf9b1d5d8d6d00 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 31 Dec 2008 18:06:57 -0800 Subject: Fix all warnings in source3 with gcc4.3. Jeremy. --- source3/modules/vfs_netatalk.c | 8 ++++++-- source3/modules/vfs_recycle.c | 13 +++++++++---- 2 files changed, 15 insertions(+), 6 deletions(-) (limited to 'source3/modules') diff --git a/source3/modules/vfs_netatalk.c b/source3/modules/vfs_netatalk.c index ca7085ca18..e2fa0fb88a 100644 --- a/source3/modules/vfs_netatalk.c +++ b/source3/modules/vfs_netatalk.c @@ -367,7 +367,9 @@ static int atalk_chown(struct vfs_handle_struct *handle, const char *path, uid_t goto exit_chown; } - chown(adbl_path, uid, gid); + if (chown(adbl_path, uid, gid) == -1) { + DEBUG(3, ("ATALK: chown error %s\n", strerror(errno))); + } exit_chown: talloc_destroy(ctx); @@ -399,7 +401,9 @@ static int atalk_lchown(struct vfs_handle_struct *handle, const char *path, uid_ goto exit_lchown; } - lchown(adbl_path, uid, gid); + if (lchown(adbl_path, uid, gid) == -1) { + DEBUG(3, ("ATALK: lchown error %s\n", strerror(errno))); + } exit_lchown: talloc_destroy(ctx); diff --git a/source3/modules/vfs_recycle.c b/source3/modules/vfs_recycle.c index acc1936e5f..cb985e1be2 100644 --- a/source3/modules/vfs_recycle.c +++ b/source3/modules/vfs_recycle.c @@ -525,7 +525,9 @@ static int recycle_unlink(vfs_handle_struct *handle, const char *file_name) } if (recycle_keep_dir_tree(handle) == True) { - asprintf(&temp_name, "%s/%s", repository, path_name); + if (asprintf(&temp_name, "%s/%s", repository, path_name) == -1) { + ALLOC_CHECK(temp_name, done); + } } else { temp_name = SMB_STRDUP(repository); } @@ -543,8 +545,9 @@ static int recycle_unlink(vfs_handle_struct *handle, const char *file_name) } } - asprintf(&final_name, "%s/%s", temp_name, base); - ALLOC_CHECK(final_name, done); + if (asprintf(&final_name, "%s/%s", temp_name, base) == -1) { + ALLOC_CHECK(final_name, done); + } DEBUG(10, ("recycle: recycled file name: %s\n", final_name)); /* new filename with path */ /* check if we should delete file from recycle bin */ @@ -561,7 +564,9 @@ static int recycle_unlink(vfs_handle_struct *handle, const char *file_name) i = 1; while (recycle_file_exist(handle, final_name)) { SAFE_FREE(final_name); - asprintf(&final_name, "%s/Copy #%d of %s", temp_name, i++, base); + if (asprintf(&final_name, "%s/Copy #%d of %s", temp_name, i++, base) == -1) { + ALLOC_CHECK(final_name, done); + } } DEBUG(10, ("recycle: Moving %s to %s\n", file_name, final_name)); -- cgit v1.2.3