From: Greg Kroah-Hartman Date: Thu, 22 May 2008 03:36:58 +0000 (-0700) Subject: if --bash is set, don't spit out error messages, we don't care. X-Git-Url: https://git.toastfreeware.priv.at/gregoa/bti.git/commitdiff_plain/b082eac904dfb710f9439da83413fbdf863957bf if --bash is set, don't spit out error messages, we don't care. --- diff --git a/bti.c b/bti.c index bf6a809..5921e3d 100644 --- a/bti.c +++ b/bti.c @@ -219,8 +219,8 @@ static int send_tweet(struct session *session) curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, curl_callback); curl_easy_setopt(curl, CURLOPT_WRITEDATA, curl_buf); res = curl_easy_perform(curl); - if (res) { - printf("error(%d) trying to send tweet\n", res); + if (res && !session->bash) { + fprintf(stderr, "error(%d) trying to send tweet\n", res); return -EINVAL; } @@ -408,7 +408,7 @@ int main(int argc, char *argv[], char *envp[]) } retval = send_tweet(session); - if (retval) { + if (retval && !session->bash) { fprintf(stderr, "tweet failed\n"); return -1; }