X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=notmuch-tag.c;h=36b9b0927585ba0f8a2ee50a74e6aaf7d7cad8e3;hp=537d5a4d1625d0747b1fe74f2045a150ee4b67d9;hb=353577ad5733b78b71d93c9bdbaae0b062d32331;hpb=da67bf12ce122759f72d1d510fb8996df3c9f946 diff --git a/notmuch-tag.c b/notmuch-tag.c index 537d5a4d..36b9b092 100644 --- a/notmuch-tag.c +++ b/notmuch-tag.c @@ -26,7 +26,12 @@ static void handle_sigint (unused (int sig)) { static char msg[] = "Stopping... \n"; - write(2, msg, sizeof(msg)-1); + + /* This write is "opportunistic", so it's okay to ignore the + * result. It is not required for correctness, and if it does + * fail or produce a short write, we want to get out of the signal + * handler as quickly as possible, not retry it. */ + IGNORE_RESULT (write (2, msg, sizeof(msg)-1)); interrupted = 1; } @@ -106,7 +111,7 @@ _optimize_tag_query (void *ctx, const char *orig_query_string, char *argv[], } int -notmuch_tag_command (void *ctx, unused (int argc), unused (char *argv[])) +notmuch_tag_command (void *ctx, int argc, char *argv[]) { int *add_tags, *remove_tags; int add_tags_count = 0;