Skip to content

Commit

Permalink
Fix warnings on 32-bit platforms.
Browse files Browse the repository at this point in the history
  • Loading branch information
chenshuo committed Oct 24, 2018
1 parent a07fcf2 commit 844ef6d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion examples/procmon/procmon.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
#include <stdarg.h>
#include <stdio.h>
#include <sys/stat.h>
#define __STDC_FORMAT_MACROS
#include <inttypes.h>

using namespace muduo;
using namespace muduo::net;
Expand Down Expand Up @@ -320,7 +322,8 @@ class Procmon : boost::noncopyable
if (::lstat(namelist[i]->d_name, &stat) == 0)
{
Timestamp mtime(stat.st_mtime * Timestamp::kMicroSecondsPerSecond);
appendResponse("%c %9ld %s %s", getDirType(namelist[i]->d_type), stat.st_size,
int64_t size = stat.st_size;
appendResponse("%c %9" PRId64 " %s %s", getDirType(namelist[i]->d_type), size,
mtime.toFormattedString(/*showMicroseconds=*/false).c_str(),
namelist[i]->d_name);
if (namelist[i]->d_type == DT_LNK)
Expand Down

0 comments on commit 844ef6d

Please sign in to comment.