From b1ce226af8b61ad7e3c37860a59c6715012e738b Mon Sep 17 00:00:00 2001 From: James Peach Date: Fri, 15 Jun 2007 21:58:49 +0000 Subject: r23510: Tidy calls to smb_panic by removing trailing newlines. Print the failed expression in SMB_ASSERT. (This used to be commit 171dc060e2a576d724eed1ca65636bdafffd7713) --- source3/locking/brlock.c | 10 +++++----- source3/locking/locking.c | 24 ++++++++++++------------ source3/locking/posix.c | 22 +++++++++++----------- 3 files changed, 28 insertions(+), 28 deletions(-) (limited to 'source3/locking') diff --git a/source3/locking/brlock.c b/source3/locking/brlock.c index 6713530738..e0cc4eec1e 100644 --- a/source3/locking/brlock.c +++ b/source3/locking/brlock.c @@ -577,9 +577,9 @@ OR } /* Never get here. */ - smb_panic("brlock_posix_split_merge\n"); + smb_panic("brlock_posix_split_merge"); /* Notreached. */ - abort(); + /* Keep some compilers happy. */ return 0; } @@ -1309,7 +1309,7 @@ void brl_close_fnum(struct messaging_context *msg_ctx, if (br_lck->num_locks) { locks_copy = (struct lock_struct *)TALLOC_MEMDUP(br_lck, locks, br_lck->num_locks * sizeof(struct lock_struct)); if (!locks_copy) { - smb_panic("brl_close_fnum: talloc fail.\n"); + smb_panic("brl_close_fnum: talloc failed"); } } else { locks_copy = NULL; @@ -1562,7 +1562,7 @@ static int byte_range_lock_destructor(struct byte_range_lock *br_lck) if (!NT_STATUS_IS_OK(status)) { DEBUG(0, ("delete_rec returned %s\n", nt_errstr(status))); - smb_panic("Could not delete byte range lock entry\n"); + smb_panic("Could not delete byte range lock entry"); } } else { TDB_DATA data; @@ -1575,7 +1575,7 @@ static int byte_range_lock_destructor(struct byte_range_lock *br_lck) TDB_REPLACE); if (!NT_STATUS_IS_OK(status)) { DEBUG(0, ("store returned %s\n", nt_errstr(status))); - smb_panic("Could not store byte range mode entry\n"); + smb_panic("Could not store byte range mode entry"); } } diff --git a/source3/locking/locking.c b/source3/locking/locking.c index 8070f4b9b3..6f7d2d53c6 100644 --- a/source3/locking/locking.c +++ b/source3/locking/locking.c @@ -479,7 +479,7 @@ static BOOL parse_share_modes(TDB_DATA dbuf, struct share_mode_lock *lck) int i; if (dbuf.dsize < sizeof(struct locking_data)) { - smb_panic("PANIC: parse_share_modes: buffer too short.\n"); + smb_panic("parse_share_modes: buffer too short"); } data = (struct locking_data *)dbuf.dptr; @@ -495,7 +495,7 @@ static BOOL parse_share_modes(TDB_DATA dbuf, struct share_mode_lock *lck) if ((lck->num_share_modes < 0) || (lck->num_share_modes > 1000000)) { DEBUG(0, ("invalid number of share modes: %d\n", lck->num_share_modes)); - smb_panic("PANIC: invalid number of share modes"); + smb_panic("parse_share_modes: invalid number of share modes"); } lck->share_modes = NULL; @@ -505,7 +505,7 @@ static BOOL parse_share_modes(TDB_DATA dbuf, struct share_mode_lock *lck) if (dbuf.dsize < (sizeof(struct locking_data) + (lck->num_share_modes * sizeof(struct share_mode_entry)))) { - smb_panic("PANIC: parse_share_modes: buffer too short.\n"); + smb_panic("parse_share_modes: buffer too short"); } lck->share_modes = (struct share_mode_entry *) @@ -514,7 +514,7 @@ static BOOL parse_share_modes(TDB_DATA dbuf, struct share_mode_lock *lck) sizeof(struct share_mode_entry)); if (lck->share_modes == NULL) { - smb_panic("talloc failed\n"); + smb_panic("parse_share_modes: talloc failed"); } } @@ -528,12 +528,12 @@ static BOOL parse_share_modes(TDB_DATA dbuf, struct share_mode_lock *lck) ((data->u.s.delete_token_size - sizeof(uid_t)) % sizeof(gid_t)) != 0) { DEBUG(0, ("parse_share_modes: invalid token size %d\n", data->u.s.delete_token_size)); - smb_panic("parse_share_modes: invalid token size\n"); + smb_panic("parse_share_modes: invalid token size"); } lck->delete_token = TALLOC_P(lck, UNIX_USER_TOKEN); if (!lck->delete_token) { - smb_panic("talloc failed\n"); + smb_panic("parse_share_modes: talloc failed"); } /* Copy out the uid and gid. */ @@ -552,7 +552,7 @@ static BOOL parse_share_modes(TDB_DATA dbuf, struct share_mode_lock *lck) lck->delete_token->groups = TALLOC_ARRAY(lck->delete_token, gid_t, lck->delete_token->ngroups); if (!lck->delete_token) { - smb_panic("talloc failed\n"); + smb_panic("parse_share_modes: talloc failed"); } for (i = 0; i < lck->delete_token->ngroups; i++) { @@ -571,7 +571,7 @@ static BOOL parse_share_modes(TDB_DATA dbuf, struct share_mode_lock *lck) sizeof(struct share_mode_entry)) + data->u.s.delete_token_size ); if (lck->servicepath == NULL) { - smb_panic("talloc_strdup failed\n"); + smb_panic("parse_share_modes: talloc_strdup failed"); } lck->filename = talloc_strdup(lck, (const char *)dbuf.dptr + sizeof(*data) + @@ -580,7 +580,7 @@ static BOOL parse_share_modes(TDB_DATA dbuf, struct share_mode_lock *lck) data->u.s.delete_token_size + strlen(lck->servicepath) + 1 ); if (lck->filename == NULL) { - smb_panic("talloc_strdup failed\n"); + smb_panic("parse_share_modes: talloc_strdup failed"); } /* @@ -637,7 +637,7 @@ static TDB_DATA unparse_share_modes(struct share_mode_lock *lck) result.dptr = TALLOC_ARRAY(lck, uint8, result.dsize); if (result.dptr == NULL) { - smb_panic("talloc failed\n"); + smb_panic("talloc failed"); } data = (struct locking_data *)result.dptr; @@ -703,7 +703,7 @@ static int share_mode_lock_destructor(struct share_mode_lock *lck) if (!NT_STATUS_IS_OK(status)) { DEBUG(0, ("delete_rec returned %s\n", nt_errstr(status))); - smb_panic("Could not delete share entry\n"); + smb_panic("could not delete share entry"); } } goto done; @@ -712,7 +712,7 @@ static int share_mode_lock_destructor(struct share_mode_lock *lck) status = lck->record->store(lck->record, data, TDB_REPLACE); if (!NT_STATUS_IS_OK(status)) { DEBUG(0, ("store returned %s\n", nt_errstr(status))); - smb_panic("Could not store share mode entry\n"); + smb_panic("could not store share mode entry"); } done: diff --git a/source3/locking/posix.c b/source3/locking/posix.c index 73fc2c7bd0..0b38d289d8 100644 --- a/source3/locking/posix.c +++ b/source3/locking/posix.c @@ -434,7 +434,7 @@ static void increment_windows_lock_ref_count(files_struct *fsp) if (dbuf.dptr == NULL) { dbuf.dptr = (uint8 *)SMB_MALLOC_P(int); if (!dbuf.dptr) { - smb_panic("increment_windows_lock_ref_count: malloc fail.\n"); + smb_panic("increment_windows_lock_ref_count: malloc fail"); } memset(dbuf.dptr, '\0', sizeof(int)); dbuf.dsize = sizeof(int); @@ -445,7 +445,7 @@ static void increment_windows_lock_ref_count(files_struct *fsp) memcpy(dbuf.dptr, &lock_ref_count, sizeof(int)); if (tdb_store(posix_pending_close_tdb, kbuf, dbuf, TDB_REPLACE) == -1) { - smb_panic("increment_windows_lock_ref_count: tdb_store_fail.\n"); + smb_panic("increment_windows_lock_ref_count: tdb_store_fail"); } SAFE_FREE(dbuf.dptr); @@ -461,7 +461,7 @@ static void decrement_windows_lock_ref_count(files_struct *fsp) dbuf = tdb_fetch(posix_pending_close_tdb, kbuf); if (!dbuf.dptr) { - smb_panic("decrement_windows_lock_ref_count: logic error.\n"); + smb_panic("decrement_windows_lock_ref_count: logic error"); } memcpy(&lock_ref_count, dbuf.dptr, sizeof(int)); @@ -469,11 +469,11 @@ static void decrement_windows_lock_ref_count(files_struct *fsp) memcpy(dbuf.dptr, &lock_ref_count, sizeof(int)); if (lock_ref_count < 0) { - smb_panic("decrement_windows_lock_ref_count: lock_count logic error.\n"); + smb_panic("decrement_windows_lock_ref_count: lock_count logic error"); } if (tdb_store(posix_pending_close_tdb, kbuf, dbuf, TDB_REPLACE) == -1) { - smb_panic("decrement_windows_lock_ref_count: tdb_store_fail.\n"); + smb_panic("decrement_windows_lock_ref_count: tdb_store_fail"); } SAFE_FREE(dbuf.dptr); @@ -500,12 +500,12 @@ void reduce_windows_lock_ref_count(files_struct *fsp, unsigned int dcount) lock_ref_count -= dcount; if (lock_ref_count < 0) { - smb_panic("reduce_windows_lock_ref_count: lock_count logic error.\n"); + smb_panic("reduce_windows_lock_ref_count: lock_count logic error"); } memcpy(dbuf.dptr, &lock_ref_count, sizeof(int)); if (tdb_store(posix_pending_close_tdb, kbuf, dbuf, TDB_REPLACE) == -1) { - smb_panic("reduce_windows_lock_ref_count: tdb_store_fail.\n"); + smb_panic("reduce_windows_lock_ref_count: tdb_store_fail"); } SAFE_FREE(dbuf.dptr); @@ -565,14 +565,14 @@ static void add_fd_to_close_entry(files_struct *fsp) dbuf.dptr = (uint8 *)SMB_REALLOC(dbuf.dptr, dbuf.dsize + sizeof(int)); if (!dbuf.dptr) { - smb_panic("add_fd_to_close_entry: Realloc fail !\n"); + smb_panic("add_fd_to_close_entry: SMB_REALLOC failed"); } memcpy(dbuf.dptr + dbuf.dsize, &fsp->fh->fd, sizeof(int)); dbuf.dsize += sizeof(int); if (tdb_store(posix_pending_close_tdb, kbuf, dbuf, TDB_REPLACE) == -1) { - smb_panic("add_fd_to_close_entry: tdb_store_fail.\n"); + smb_panic("add_fd_to_close_entry: tdb_store_fail"); } DEBUG(10,("add_fd_to_close_entry: added fd %d file %s\n", @@ -590,7 +590,7 @@ static void delete_close_entries(files_struct *fsp) TDB_DATA kbuf = fd_array_key_fsp(fsp); if (tdb_delete(posix_pending_close_tdb, kbuf) == -1) { - smb_panic("delete_close_entries: tdb_delete fail !\n"); + smb_panic("delete_close_entries: tdb_delete failed"); } } @@ -934,7 +934,7 @@ new: start=%.0f,size=%.0f\n", (double)l_curr->start, (double)l_curr->size, pstring msg; slprintf(msg, sizeof(msg)-1, "logic flaw in cases: l_curr: start = %.0f, size = %.0f : \ -lock: start = %.0f, size = %.0f\n", (double)l_curr->start, (double)l_curr->size, (double)lock->start, (double)lock->size ); +lock: start = %.0f, size = %.0f", (double)l_curr->start, (double)l_curr->size, (double)lock->start, (double)lock->size ); smb_panic(msg); } -- cgit