mirror of
https://github.com/obarthel/amiga-smbfs.git
synced 2025-12-08 14:58:35 +00:00
success/error handling is now consistent
All functions now follow a consistent error reporting scheme. A negative return value always indicates an error condition. A return value of 0 always indicates success, except for the few functions which have to return a count of bytes or directory records upon success. Previously, it was hard to tell what function returned what in case of error, which led the bugs in smba_write() and smba_read(), neither of which gracefully fell back on SMB_COM_WRITE/SMB_COM_READ, respectively if SMB_COM_WRITE_RAW/SMB_COM_READ_RAW failed. State variables are now named according to their respective purpose where possible. Previously, it was "rval", "errnum", "result" which were used almost interchangeably regardless of purpose.
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
/*
|
||||
* $Id: smb_fs.h,v 1.1.1.1 2005-05-24 13:22:13 obarthel Exp $
|
||||
* $Id: smb_fs.h,v 1.1.1.1 2005/05/24 13:22:13 obarthel Exp $
|
||||
*
|
||||
* :ts=8
|
||||
*
|
||||
* smb_fs.h
|
||||
*
|
||||
* Copyright (C) 1995 by Paal-Kr. Engstad and Volker Lendecke
|
||||
* Modified for use with AmigaOS by Olaf Barthel <olsen@sourcery.han.de>
|
||||
* Modified for use with AmigaOS by Olaf Barthel <obarthel -at- gmx -dot- net>
|
||||
* Modified for supporting SMBlockingX packets by Peter Riede <Noster-Riede@T-Online.de>
|
||||
*/
|
||||
|
||||
@@ -48,7 +48,7 @@ struct smb_lkrng
|
||||
|
||||
/* proc.c */
|
||||
byte *smb_encode_smb_length(byte *p, dword len);
|
||||
dword smb_len(byte *packet);
|
||||
dword smb_len(const byte *packet);
|
||||
int smb_proc_open(struct smb_server *server, const char *pathname, int len, struct smb_dirent *entry);
|
||||
int smb_proc_close(struct smb_server *server, word fileid, dword mtime);
|
||||
int smb_proc_read(struct smb_server *server, struct smb_dirent *finfo, off_t offset, long count, char *data, int fs);
|
||||
@@ -72,6 +72,7 @@ int smb_proc_dskattr (struct smb_server *server, struct smb_dskattr *attr);
|
||||
int smb_proc_connect(struct smb_server *server);
|
||||
|
||||
/* sock.c */
|
||||
int smb_receive (struct smb_server *server, int sock_fd);
|
||||
int smb_catch_keepalive(struct smb_server *server);
|
||||
int smb_dont_catch_keepalive(struct smb_server *server);
|
||||
int smb_release(struct smb_server *server);
|
||||
|
||||
Reference in New Issue
Block a user