fixed -W, working on -r

This commit is contained in:
elvis
2022-04-25 20:24:55 +02:00
parent d8a0220ade
commit e67d3b5580
8 changed files with 72 additions and 105 deletions

View File

@ -306,7 +306,7 @@ void readFile(char *filepath, queueT *q, long fd_c, taglia_t *taglia) {
size_t m = sizeof(tmp_buf);
if(!filepath || !q || !taglia) {
n += snprintf(tmp_buf+n, m-n, "Client %ld ha richiesto una readFile sul file \"%s\" e' terminata con errore\n", fd_c, filepath);
n += snprintf(tmp_buf+n, m-n, "Client %ld ha richiesto una readFile sul file \"%s\" e' terminata con errore del server\n", fd_c, filepath);
errno = EINVAL;
serror(MESY, fd_c, taglia, tmp_buf);
return;
@ -315,7 +315,7 @@ void readFile(char *filepath, queueT *q, long fd_c, taglia_t *taglia) {
fileT *f = NULL;
f = find(q, filepath);
if(!f) {
n += snprintf(tmp_buf+n, m-n, "Client %ld ha richiesto una readFile sul file \"%s\" e' terminata con errore\n", fd_c, filepath);
n += snprintf(tmp_buf+n, m-n, "Client %ld ha richiesto una readFile sul file \"%s\" ma il file non esiste\n", fd_c, filepath);
errno = ENOENT;
serror(MESE, fd_c, taglia, tmp_buf);
return;