if --bash is set, don't spit out error messages, we don't care.
authorGreg Kroah-Hartman <gregkh@suse.de>
Thu, 22 May 2008 03:36:58 +0000 (20:36 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 22 May 2008 03:36:58 +0000 (20:36 -0700)
bti.c

diff --git a/bti.c b/bti.c
index bf6a809d355bcc57adad30ac14cc67152e5bda89..5921e3d7afc92988d4964520de75d61d4ab20bd0 100644 (file)
--- 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;
        }