diff options
author | gstein <gstein@13f79535-47bb-0310-9956-ffa450edef68> | 2000-07-08 11:31:49 +0000 |
---|---|---|
committer | gstein <gstein@13f79535-47bb-0310-9956-ffa450edef68> | 2000-07-08 11:31:49 +0000 |
commit | 0f9e8d9b6c612e60d0943bb4ed4e468b545c946b (patch) | |
tree | 403986b3f158c7a4a22578129cc3ab8cccb2c609 /file_io/unix/fileacc.c | |
parent | f8488d5d71c9952c8cc05ac6a4b0ab129056e87e (diff) | |
download | libapr-0f9e8d9b6c612e60d0943bb4ed4e468b545c946b.tar.gz |
a while back, we said "segfault on invalid params rather than returning an
error." this removes some of the error checking that was occurring in the
"user data" functions. also saw some in the "get/set OS type" functions and
nuked those; there are still checks for pool==NULL, though, since that would
end up making us malloc() rather than segfault'ing.
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@60318 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'file_io/unix/fileacc.c')
-rw-r--r-- | file_io/unix/fileacc.c | 27 |
1 files changed, 5 insertions, 22 deletions
diff --git a/file_io/unix/fileacc.c b/file_io/unix/fileacc.c index 7039d9e65..e64336421 100644 --- a/file_io/unix/fileacc.c +++ b/file_io/unix/fileacc.c @@ -69,16 +69,10 @@ #endif /* A file to put ALL of the accessor functions for ap_file_t types. */ -ap_status_t ap_get_filename(char **new, ap_file_t *thefile) +ap_status_t ap_get_filename(char **fname, ap_file_t *thefile) { - if (thefile != NULL) { - *new = ap_pstrdup(thefile->cntxt, thefile->fname); - return APR_SUCCESS; - } - else { - *new = NULL; - return APR_ENOFILE; - } + *fname = ap_pstrdup(thefile->cntxt, thefile->fname); + return APR_SUCCESS; } #if !defined(OS2) && !defined(WIN32) @@ -141,22 +135,11 @@ ap_fileperms_t ap_unix_mode2perms(mode_t mode) ap_status_t ap_get_filedata(void **data, const char *key, ap_file_t *file) { - if (file != NULL) { - return ap_get_userdata(data, key, file->cntxt); - } - else { - *data = NULL; - return APR_ENOFILE; - } + return ap_get_userdata(data, key, file->cntxt); } ap_status_t ap_set_filedata(ap_file_t *file, void *data, const char *key, ap_status_t (*cleanup) (void *)) { - if (file != NULL) { - return ap_set_userdata(data, key, cleanup, file->cntxt); - } - else { - return APR_ENOFILE; - } + return ap_set_userdata(data, key, cleanup, file->cntxt); } |