]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
fix negative number in printf
authorAnthony Minessale <anthony.minessale@gmail.com>
Mon, 22 Sep 2008 21:53:50 +0000 (21:53 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Mon, 22 Sep 2008 21:53:50 +0000 (21:53 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@9620 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/endpoints/mod_sofia/mod_sofia.c

index 09b9422208a0da6a403dd97407f1bcb1340eeb97..b66f73edbc8bfb313ad6315534abea0e2a22f6d0 100644 (file)
@@ -1376,7 +1376,12 @@ static switch_status_t cmd_status(char **argv, int argc, switch_stream_handle_t
                                        switch_assert(gp->state < REG_STATE_LAST);
                                        stream->write_function(stream, "%25s\t%s\t  %32s\t%s", gp->name, "gateway", gp->register_to, sofia_state_names[gp->state]);
                                        if (gp->state == REG_STATE_FAILED || gp->state == REG_STATE_TRYING) {
-                                               stream->write_function(stream, " (retry: %ds)", gp->retry - switch_timestamp(NULL));
+                                               time_t now = switch_timestamp(NULL);
+                                               if (gp->retry > now) {
+                                                       stream->write_function(stream, " (retry: %ds)", gp->retry - now);
+                                               } else {
+                                                       stream->write_function(stream, " (retry: NEVER)");
+                                               }
                                        }
                                        stream->write_function(stream, "\n");
                                }