mirror of
https://github.com/libfuse/libfuse.git
synced 2024-11-27 06:04:27 +08:00
Add support for more detailed error codes from main loop
This commit is contained in:
parent
2e6cd2d425
commit
c22da7f3a8
@ -7,6 +7,10 @@ UNRELEASED CHANGES
|
||||
|
||||
* Added documentation for FUSE_CAP_FLOCK_LOCKS.
|
||||
|
||||
* fuse_loop(), fuse_loop_mt(), fuse_session_loop() and
|
||||
fuse_session_loop_mt() now return -errno instead of -1 in case of
|
||||
failure.
|
||||
|
||||
FUSE 3.0.0-rc2 (2016-11-06)
|
||||
===========================
|
||||
|
||||
|
@ -828,7 +828,7 @@ void fuse_destroy(struct fuse *f);
|
||||
* operations are called.
|
||||
*
|
||||
* @param f the FUSE handle
|
||||
* @return 0 if no error occurred, -1 otherwise
|
||||
* @return 0 if no error occurred, -errno otherwise
|
||||
*
|
||||
* See also: fuse_loop()
|
||||
*/
|
||||
@ -871,7 +871,7 @@ void fuse_exit(struct fuse *f);
|
||||
* @param f the FUSE handle
|
||||
* @param clone_fd whether to use separate device fds for each thread
|
||||
* (may increase performance)
|
||||
* @return 0 if no error occurred, -1 otherwise
|
||||
* @return 0 if no error occurred, -errno otherwise
|
||||
*
|
||||
* See also: fuse_loop()
|
||||
*/
|
||||
|
@ -1783,7 +1783,7 @@ int fuse_session_mount(struct fuse_session *se, const char *mountpoint);
|
||||
* fuse_set_signal_handlers() first.
|
||||
*
|
||||
* @param se the session
|
||||
* @return 0 on success, -1 on error
|
||||
* @return 0 on success, -errno on failure
|
||||
*/
|
||||
int fuse_session_loop(struct fuse_session *se);
|
||||
|
||||
@ -1793,7 +1793,7 @@ int fuse_session_loop(struct fuse_session *se);
|
||||
* @param se the session
|
||||
* @param clone_fd whether to use separate device fds for each thread
|
||||
* (may increase performance)
|
||||
* @return 0 on success, -1 on error
|
||||
* @return 0 on success, -errno on failure
|
||||
*/
|
||||
int fuse_session_loop_mt(struct fuse_session *se, int clone_fd);
|
||||
|
||||
|
@ -63,6 +63,7 @@ struct fuse_session {
|
||||
uint64_t notify_ctr;
|
||||
struct fuse_notify_req notify_list;
|
||||
size_t bufsize;
|
||||
int error;
|
||||
};
|
||||
|
||||
struct fuse_chan {
|
||||
|
@ -35,6 +35,8 @@ int fuse_session_loop(struct fuse_session *se)
|
||||
}
|
||||
|
||||
free(fbuf.mem);
|
||||
if(se->error != 0)
|
||||
res = se->error;
|
||||
fuse_session_reset(se);
|
||||
return res < 0 ? -1 : 0;
|
||||
return res;
|
||||
}
|
||||
|
@ -339,6 +339,8 @@ int fuse_session_loop_mt(struct fuse_session *se, int clone_fd)
|
||||
|
||||
pthread_mutex_destroy(&mt.lock);
|
||||
sem_destroy(&mt.finish);
|
||||
if(se->error != 0)
|
||||
err = se->error;
|
||||
fuse_session_reset(se);
|
||||
return err;
|
||||
}
|
||||
|
@ -2940,6 +2940,7 @@ void fuse_session_exit(struct fuse_session *se)
|
||||
void fuse_session_reset(struct fuse_session *se)
|
||||
{
|
||||
se->exited = 0;
|
||||
se->error = 0;
|
||||
}
|
||||
|
||||
int fuse_session_exited(struct fuse_session *se)
|
||||
|
Loading…
Reference in New Issue
Block a user