From 46b76af6456dd448b1b985400e847e564197dfa6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Fri, 8 Sep 2023 13:06:28 +0200 Subject: [PATCH] xfer: display an error message when opening file for read or write fails (issue #2010) --- ChangeLog.adoc | 1 + po/cs.po | 11 ++++++++++- po/de.po | 12 +++++++++++- po/es.po | 12 +++++++++++- po/fr.po | 12 ++++++++++-- po/hu.po | 10 +++++++++- po/it.po | 12 +++++++++++- po/ja.po | 12 +++++++++++- po/pl.po | 12 +++++++++++- po/pt.po | 12 +++++++++++- po/pt_BR.po | 12 +++++++++++- po/ru.po | 10 +++++++++- po/sr.po | 12 +++++++++++- po/tr.po | 12 +++++++++++- po/weechat.pot | 10 +++++++++- src/plugins/xfer/xfer-network.c | 28 ++++++++++++++++++++++++++-- 16 files changed, 173 insertions(+), 17 deletions(-) diff --git a/ChangeLog.adoc b/ChangeLog.adoc index e8f7fd018..62ea1989f 100644 --- a/ChangeLog.adoc +++ b/ChangeLog.adoc @@ -65,6 +65,7 @@ Bug fixes:: * script: add parameters up/down/go in `/help script` and command completion * script: fix cursor position after `/script list -i` or `/script list -il` * script: fix buffer used by command `/script list -i|-il|-o|-ol` + * xfer: display an error message when opening file for read or write fails (issue #2010) Tests:: diff --git a/po/cs.po b/po/cs.po index 90b402054..340a41afc 100644 --- a/po/cs.po +++ b/po/cs.po @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2023-09-08 13:01+0200\n" +"POT-Creation-Date: 2023-09-08 13:02+0200\n" "PO-Revision-Date: 2023-09-06 19:13+0200\n" "Last-Translator: Ondřej Súkup \n" "Language-Team: weechat-dev \n" @@ -14542,6 +14542,11 @@ msgstr "%s%s: špatný kontrolní součet CRC32 souboru %s" msgid "%s%s: CRC32 error while resuming" msgstr "%s%s: chyba při načítání souboru \"%s\"" +#, fuzzy, c-format +#| msgid "%s%s: unable to read file \"%s\"" +msgid "%s%s: unable to read file \"%s\": %s" +msgstr "%s%s: nemůžu číst soubor \"%s\"" + #, fuzzy, c-format msgid "%s%s: unable to fork (%s)" msgstr "%s%s: nemohu provést fork" @@ -14554,6 +14559,10 @@ msgstr "" "%s: posílám soubor k %s: %s (lokální jméno souboru: %s), %llu bytů " "(protokol: %s)" +#, fuzzy, c-format +msgid "%s%s: unable to write file \"%s\": %s" +msgstr "%s%s: nemůžu zapsat log soubor \"%s\"" + #, fuzzy, c-format msgid "%s%s: unable to create socket for sending file: error %d %s" msgstr "%s%s: nemohu vytvořit soket pro odesílání souboru" diff --git a/po/de.po b/po/de.po index d91ad2eba..466acb829 100644 --- a/po/de.po +++ b/po/de.po @@ -26,7 +26,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2023-09-08 13:01+0200\n" +"POT-Creation-Date: 2023-09-08 13:02+0200\n" "PO-Revision-Date: 2023-09-08 07:55+0200\n" "Last-Translator: Nils Görs \n" "Language-Team: German \n" @@ -17428,6 +17428,11 @@ msgstr "%s%s: Datei %s besitzt fehlerhafte CRC32 Prüfsumme" msgid "%s%s: CRC32 error while resuming" msgstr "%s%s: CRC32 Fehler bei der Wiederaufnahme" +#, fuzzy, c-format +#| msgid "%s%s: unable to read file \"%s\"" +msgid "%s%s: unable to read file \"%s\": %s" +msgstr "%s%s: Datei \"%s\" kann nicht gelesen werden" + #, c-format msgid "%s%s: unable to fork (%s)" msgstr "%s%s: ein Fork kann nicht erstellt werden (%s)" @@ -17440,6 +17445,11 @@ msgstr "" "%s: sende Datei an %s (%s, %s.%s), Name: %s (lokaler Dateiname: %s), %llu " "Bytes (Protokoll: %s)" +#, fuzzy, c-format +#| msgid "%s%s: unable to write log file \"%s\": %s" +msgid "%s%s: unable to write file \"%s\": %s" +msgstr "%s%s: Protokoll-Datei \"%s\" kann nicht geschrieben werden: %s" + #, c-format msgid "%s%s: unable to create socket for sending file: error %d %s" msgstr "" diff --git a/po/es.po b/po/es.po index bf3b6ac51..edd9bc037 100644 --- a/po/es.po +++ b/po/es.po @@ -22,7 +22,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2023-09-08 13:01+0200\n" +"POT-Creation-Date: 2023-09-08 13:02+0200\n" "PO-Revision-Date: 2023-09-06 19:13+0200\n" "Last-Translator: Santiago Forero \n" "Language-Team: weechat-dev \n" @@ -15221,6 +15221,11 @@ msgstr "%s%s: argumentos incorrectos para la función \"%s\" (script: %s)" msgid "%s%s: CRC32 error while resuming" msgstr "%s%s: error mientras se cargaba el archivo \"%s\"" +#, fuzzy, c-format +#| msgid "%s%s: unable to read file \"%s\"" +msgid "%s%s: unable to read file \"%s\": %s" +msgstr "%s%s: no es posible leer el archivo \"%s\"" + #, fuzzy, c-format msgid "%s%s: unable to fork (%s)" msgstr "%s%s: no es posible bifurcarse" @@ -15233,6 +15238,11 @@ msgstr "" "%s: enviando archivo a %s (%s, %s.%s), nombre: %s (archivo local: %s), %llu " "bytes (protocolo: %s)" +#, fuzzy, c-format +#| msgid "%s%s: unable to write log file \"%s\": %s" +msgid "%s%s: unable to write file \"%s\": %s" +msgstr "%s%s: imposible escribir en el registro \"%s\": %s" + #, c-format msgid "%s%s: unable to create socket for sending file: error %d %s" msgstr "" diff --git a/po/fr.po b/po/fr.po index 20861d1b9..efde3c4eb 100644 --- a/po/fr.po +++ b/po/fr.po @@ -21,8 +21,8 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2023-09-08 13:01+0200\n" -"PO-Revision-Date: 2023-09-08 13:02+0200\n" +"POT-Creation-Date: 2023-09-08 13:02+0200\n" +"PO-Revision-Date: 2023-09-08 13:03+0200\n" "Last-Translator: Sébastien Helleu \n" "Language-Team: weechat-dev \n" "Language: fr\n" @@ -17127,6 +17127,10 @@ msgstr "%s%s : mauvais CRC32 pour le fichier %s" msgid "%s%s: CRC32 error while resuming" msgstr "%s%s : erreur CRC32 durant la reprise" +#, c-format +msgid "%s%s: unable to read file \"%s\": %s" +msgstr "%s%s : impossible de lire le fichier \"%s\" : %s" + #, c-format msgid "%s%s: unable to fork (%s)" msgstr "%s%s : impossible de créer un processus (%s)" @@ -17139,6 +17143,10 @@ msgstr "" "%s : offre de fichier pour %s (%s, %s.%s), nom : %s (nom local : %s), %llu " "octets (protocole : %s)" +#, c-format +msgid "%s%s: unable to write file \"%s\": %s" +msgstr "%s%s : impossible d'écrire le fichier \"%s\" : %s" + #, c-format msgid "%s%s: unable to create socket for sending file: error %d %s" msgstr "" diff --git a/po/hu.po b/po/hu.po index f9a39d383..8ba10c491 100644 --- a/po/hu.po +++ b/po/hu.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2023-09-08 13:01+0200\n" +"POT-Creation-Date: 2023-09-08 13:02+0200\n" "PO-Revision-Date: 2023-09-06 19:13+0200\n" "Last-Translator: Andras Voroskoi \n" "Language-Team: weechat-dev \n" @@ -13767,6 +13767,10 @@ msgstr "%s rossz argumentum a \"%s\" parancsnak\n" msgid "%s%s: CRC32 error while resuming" msgstr "Nem sikerült a(z) \"%s\" naplófájlt írni\n" +#, fuzzy, c-format +msgid "%s%s: unable to read file \"%s\": %s" +msgstr "Nem sikerült a(z) \"%s\" naplófájlt írni\n" + #, fuzzy, c-format msgid "%s%s: unable to fork (%s)" msgstr "%s DCC: nem sikerült forkolni\n" @@ -13779,6 +13783,10 @@ msgstr "" "DCC fájl küldése a következőnek: %s%s%s: %s%s%s (helyi fájlnév: %s%s%s), " "%s%lu%s bájt\n" +#, fuzzy, c-format +msgid "%s%s: unable to write file \"%s\": %s" +msgstr "Nem sikerült a(z) \"%s\" naplófájlt írni\n" + #, fuzzy, c-format msgid "%s%s: unable to create socket for sending file: error %d %s" msgstr "%s DCC: nem sikerült csatornát nyitni a fájlküldéshez\n" diff --git a/po/it.po b/po/it.po index 735a8cf06..468ff2858 100644 --- a/po/it.po +++ b/po/it.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2023-09-08 13:01+0200\n" +"POT-Creation-Date: 2023-09-08 13:02+0200\n" "PO-Revision-Date: 2023-09-06 19:13+0200\n" "Last-Translator: Esteban I. Ruiz Moreno \n" "Language-Team: weechat-dev \n" @@ -14990,6 +14990,11 @@ msgstr "%s%s: argomenti errati per la funzione \"%s\" (script: %s)" msgid "%s%s: CRC32 error while resuming" msgstr "%s%s: errore durante il caricamento del file \"%s\"" +#, fuzzy, c-format +#| msgid "%s%s: unable to read file \"%s\"" +msgid "%s%s: unable to read file \"%s\": %s" +msgstr "%s%s: impossibile leggere il file \"%s\"" + #, fuzzy, c-format msgid "%s%s: unable to fork (%s)" msgstr "%s%s: impossibile effettuare il fork" @@ -15002,6 +15007,11 @@ msgstr "" "%s: invio file a %s (%s.%s), nome: %s (nome file locale: %s), %llu byte " "(protocollo: %s)" +#, fuzzy, c-format +#| msgid "%s%s: unable to write log file \"%s\": %s" +msgid "%s%s: unable to write file \"%s\": %s" +msgstr "%s%s: impossibile scrivere il file di log \"%s\": %s" + #, c-format msgid "%s%s: unable to create socket for sending file: error %d %s" msgstr "%s%s: impossibile creare il socket per inviare il file: errore %d %s" diff --git a/po/ja.po b/po/ja.po index 7e6b9a103..210611c16 100644 --- a/po/ja.po +++ b/po/ja.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2023-09-08 13:01+0200\n" +"POT-Creation-Date: 2023-09-08 13:02+0200\n" "PO-Revision-Date: 2023-09-06 19:13+0200\n" "Last-Translator: AYANOKOUZI, Ryuunosuke \n" "Language-Team: Japanese \n" "Language-Team: Polish \n" @@ -18105,6 +18105,11 @@ msgstr "%s%s: nieprawidłowa wartość CRC32 dla pliku %s" msgid "%s%s: CRC32 error while resuming" msgstr "%s%s: błąd CRC32 podczas wznawiania" +#, fuzzy, c-format +#| msgid "%s%s: unable to read file \"%s\"" +msgid "%s%s: unable to read file \"%s\": %s" +msgstr "%s%s: nie można odczytać pliku \"%s\"" + #, c-format msgid "%s%s: unable to fork (%s)" msgstr "%s%s: nie można sforkować (%s)" @@ -18117,6 +18122,11 @@ msgstr "" "%s: wysyłam plik do %s (%s, %s.%s), nazwa: %s (lokalny plik: %s), %llu " "bajtów (protokół: %s)" +#, fuzzy, c-format +#| msgid "%s%s: unable to write log file \"%s\": %s" +msgid "%s%s: unable to write file \"%s\": %s" +msgstr "%s%s: nie można zapisać pliku z logiem \"%s\": %s" + #, c-format msgid "%s%s: unable to create socket for sending file: error %d %s" msgstr "%s%s: nie można otworzyć gniazda do wysłania pliku: błąd %d %s" diff --git a/po/pt.po b/po/pt.po index cc808c081..d024d9526 100644 --- a/po/pt.po +++ b/po/pt.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2023-09-08 13:01+0200\n" +"POT-Creation-Date: 2023-09-08 13:02+0200\n" "PO-Revision-Date: 2023-09-06 19:13+0200\n" "Last-Translator: Vasco Almeida \n" "Language-Team: Portuguese <>\n" @@ -16220,6 +16220,11 @@ msgstr "%s%s: CRC32 do ficheiro %s incorreto" msgid "%s%s: CRC32 error while resuming" msgstr "%s%s: erro de CRC32 ao resumir" +#, fuzzy, c-format +#| msgid "%s%s: unable to read file \"%s\"" +msgid "%s%s: unable to read file \"%s\": %s" +msgstr "%s%s: não foi possível ler o ficheiro \"%s\"" + #, c-format msgid "%s%s: unable to fork (%s)" msgstr "%s%s: não é possível efetuar fork (%s)" @@ -16232,6 +16237,11 @@ msgstr "" "%s: ficheiro enviado para %s (%s, %s.%s), nome: %s (nome local: %s), %llu " "bytes (protocolo: %s)" +#, fuzzy, c-format +#| msgid "%s%s: unable to write log file \"%s\": %s" +msgid "%s%s: unable to write file \"%s\": %s" +msgstr "%s%s: não foi possível escrever o ficheiro de registo \"%s\": %s" + #, c-format msgid "%s%s: unable to create socket for sending file: error %d %s" msgstr "%s%s: não foi possível criar socket para enviar ficheiro: erro %d %s" diff --git a/po/pt_BR.po b/po/pt_BR.po index f8faf9ad6..55eaaabdf 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2023-09-08 13:01+0200\n" +"POT-Creation-Date: 2023-09-08 13:02+0200\n" "PO-Revision-Date: 2023-09-06 19:13+0200\n" "Last-Translator: Érico Nogueira \n" "Language-Team: weechat-dev \n" @@ -14426,6 +14426,11 @@ msgstr "%s%s: argumentos inválidos para a função \"%s\" (script: %s)" msgid "%s%s: CRC32 error while resuming" msgstr "%s%s: erro na leitura do arquivo \"%s\"" +#, fuzzy, c-format +#| msgid "%s%s: unable to read file \"%s\"" +msgid "%s%s: unable to read file \"%s\": %s" +msgstr "%s%s: não foi possível ler arquivo \"%s\"" + #, fuzzy, c-format msgid "%s%s: unable to fork (%s)" msgstr "%s%s: não foi possível efetuar o fork" @@ -14438,6 +14443,11 @@ msgstr "" "%s: enviando arquivo para %s (%s.%s): %s (arquivo local: %s), %llu bytes " "(protocolo: %s)" +#, fuzzy, c-format +#| msgid "%s%s: unable to write log file \"%s\": %s" +msgid "%s%s: unable to write file \"%s\": %s" +msgstr "%s%s: não foi possível escrever arquivo de registro \"%s\": %s" + #, fuzzy, c-format msgid "%s%s: unable to create socket for sending file: error %d %s" msgstr "%s%s: não foi possível criar o socket para enviar arquivo" diff --git a/po/ru.po b/po/ru.po index a63908913..2a4a53e7b 100644 --- a/po/ru.po +++ b/po/ru.po @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2023-09-08 13:01+0200\n" +"POT-Creation-Date: 2023-09-08 13:02+0200\n" "PO-Revision-Date: 2023-09-06 19:13+0200\n" "Last-Translator: Aleksey V Zapparov AKA ixti \n" "Language-Team: weechat-dev \n" @@ -13807,6 +13807,10 @@ msgstr "%s некорректные аргументы команды \"%s\"\n" msgid "%s%s: CRC32 error while resuming" msgstr "Не могу записать лог-файл \"%s\"\n" +#, fuzzy, c-format +msgid "%s%s: unable to read file \"%s\": %s" +msgstr "Не могу записать лог-файл \"%s\"\n" + #, fuzzy, c-format msgid "%s%s: unable to fork (%s)" msgstr "%s DCC: не могу forkнуться\n" @@ -13817,6 +13821,10 @@ msgid "" "bytes (protocol: %s)" msgstr "Отправляю файл %s%s%s: %s%s%s (файл: %s%s%s), %s%lu%s байт\n" +#, fuzzy, c-format +msgid "%s%s: unable to write file \"%s\": %s" +msgstr "Не могу записать лог-файл \"%s\"\n" + #, fuzzy, c-format msgid "%s%s: unable to create socket for sending file: error %d %s" msgstr "%s DCC: не могу создать сокет для отправки файла\n" diff --git a/po/sr.po b/po/sr.po index 06cd82597..a930f19e8 100644 --- a/po/sr.po +++ b/po/sr.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2023-09-08 13:01+0200\n" +"POT-Creation-Date: 2023-09-08 13:02+0200\n" "PO-Revision-Date: 2023-09-06 19:13+0200\n" "Last-Translator: Ivan Pešić \n" "Language-Team: weechat-dev \n" @@ -16705,6 +16705,11 @@ msgstr "%s%s: погрешан CRC32 за фајл %s" msgid "%s%s: CRC32 error while resuming" msgstr "%s%s: CRC32 грешка приликом настављања" +#, fuzzy, c-format +#| msgid "%s%s: unable to read file \"%s\"" +msgid "%s%s: unable to read file \"%s\": %s" +msgstr "%s%s: фајл „%s” не може да се прочита" + #, c-format msgid "%s%s: unable to fork (%s)" msgstr "%s%s: није могуће рачвање (%s)" @@ -16717,6 +16722,11 @@ msgstr "" "%s: слање фајла за %s (%s, %s.%s), име: %s (локално име фајла: %s), %llu " "бајтова (протокол: %s)" +#, fuzzy, c-format +#| msgid "%s%s: unable to write log file \"%s\": %s" +msgid "%s%s: unable to write file \"%s\": %s" +msgstr "%s%s: не може да се упише у лог фајл „%s”: %s" + #, c-format msgid "%s%s: unable to create socket for sending file: error %d %s" msgstr "%s%s: није могао да се креира сокет за слање фајла: грешка %d %s" diff --git a/po/tr.po b/po/tr.po index 34d143206..fec6fc75e 100644 --- a/po/tr.po +++ b/po/tr.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2023-09-08 13:01+0200\n" +"POT-Creation-Date: 2023-09-08 13:02+0200\n" "PO-Revision-Date: 2023-09-06 19:13+0200\n" "Last-Translator: Emir SARI \n" "Language-Team: weechat-dev \n" @@ -17408,6 +17408,11 @@ msgstr "%s%s: %s dosyası için hatalı CRC32" msgid "%s%s: CRC32 error while resuming" msgstr "%s%s: Sürdürme sırasında CRC32 hatası" +#, fuzzy, c-format +#| msgid "%s%s: unable to read file \"%s\"" +msgid "%s%s: unable to read file \"%s\": %s" +msgstr "%s%s: \"%s\" dosyası okunamıyor" + #, c-format msgid "%s%s: unable to fork (%s)" msgstr "%s%s: Çatallanamıyor (%s)" @@ -17420,6 +17425,11 @@ msgstr "" "%s: Dosya gönderiliyor: %s (%s, %s.%s), ad: %s (yerel dosya adı: %s), %llu " "bayt (protokol: %s)" +#, fuzzy, c-format +#| msgid "%s%s: unable to write log file \"%s\": %s" +msgid "%s%s: unable to write file \"%s\": %s" +msgstr "%s%s: \"%s\" günlük dosyası yazılamıyor: %s" + #, c-format msgid "%s%s: unable to create socket for sending file: error %d %s" msgstr "%s%s: Dosya gönderimi için soket oluşturulamıyor: Hata %d %s" diff --git a/po/weechat.pot b/po/weechat.pot index 471326e8a..a2ed127a4 100644 --- a/po/weechat.pot +++ b/po/weechat.pot @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2023-09-08 13:01+0200\n" +"POT-Creation-Date: 2023-09-08 13:02+0200\n" "PO-Revision-Date: 2014-08-16 10:27+0200\n" "Last-Translator: Sébastien Helleu \n" "Language-Team: weechat-dev \n" @@ -12511,6 +12511,10 @@ msgstr "" msgid "%s%s: CRC32 error while resuming" msgstr "" +#, c-format +msgid "%s%s: unable to read file \"%s\": %s" +msgstr "" + #, c-format msgid "%s%s: unable to fork (%s)" msgstr "" @@ -12521,6 +12525,10 @@ msgid "" "bytes (protocol: %s)" msgstr "" +#, c-format +msgid "%s%s: unable to write file \"%s\": %s" +msgstr "" + #, c-format msgid "%s%s: unable to create socket for sending file: error %d %s" msgstr "" diff --git a/src/plugins/xfer/xfer-network.c b/src/plugins/xfer/xfer-network.c index d69c43cf1..4e1e13e0a 100644 --- a/src/plugins/xfer/xfer-network.c +++ b/src/plugins/xfer/xfer-network.c @@ -331,6 +331,18 @@ xfer_network_send_file_fork (struct t_xfer *xfer) xfer->file = open (xfer->local_filename, O_RDONLY | O_NONBLOCK, 0644); + if (xfer->file < 0) + { + weechat_printf (NULL, + _("%s%s: unable to read file \"%s\": %s"), + weechat_prefix ("error"), + XFER_PLUGIN_NAME, + xfer->local_filename, + strerror (errno)); + xfer_close (xfer, XFER_STATUS_FAILED); + xfer_buffer_refresh (WEECHAT_HOTLIST_MESSAGE); + } + switch (pid = fork ()) { case -1: /* fork failed */ @@ -408,6 +420,19 @@ xfer_network_recv_file_fork (struct t_xfer *xfer) 0644); } + if (xfer->file < 0) + { + weechat_printf (NULL, + _("%s%s: unable to write file \"%s\": %s"), + weechat_prefix ("error"), + XFER_PLUGIN_NAME, + xfer->temp_local_filename, + strerror (errno)); + xfer_close (xfer, XFER_STATUS_FAILED); + xfer_buffer_refresh (WEECHAT_HOTLIST_MESSAGE); + return; + } + switch (pid = fork ()) { case -1: /* fork failed */ @@ -872,11 +897,10 @@ xfer_network_connect_init (struct t_xfer *xfer) } else { + xfer->status = XFER_STATUS_CONNECTING; /* for a file: launch child process */ if (XFER_IS_FILE(xfer->type) && XFER_IS_ACTIVE(xfer->type)) xfer_network_recv_file_fork (xfer); - - xfer->status = XFER_STATUS_CONNECTING; } xfer_buffer_refresh (WEECHAT_HOTLIST_MESSAGE); }