--- smsdaemon/util.cpp 2008/06/14 08:39:40 78 +++ smsdaemon/util.cpp 2008/06/16 06:12:45 84 @@ -190,8 +190,11 @@ ostringstream command; command << "wget -O " << tempfile << " --tries=1 --timeout=15 -o /dev/null \"" << url << "\""; int res = system( command.str().c_str() ); - if (res) + + if (res>0) + { throw std::runtime_error("Command time out"); + } ifstream in( tempfile.c_str() ); @@ -277,7 +280,8 @@ int mTimeDiff(const timeval& then, const timeval& now) { - return uTimeDiff(then,now) / 1000; + return ( (now.tv_sec - then.tv_sec)*1000) + + ((now.tv_usec-then.tv_usec)/1000); } }