summaryrefslogtreecommitdiffstats
path: root/lib/Utils
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2010-01-11 07:21:31 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2010-01-11 07:21:31 +0100
commitb1c4304104910c4bc066cd43f9784fe2f3ddf1ad (patch)
treea66e2e16d7087811e10385f9f830836f555c1908 /lib/Utils
parentc2009ddeb7052dfe443f0239893f627759580c29 (diff)
downloadabrt-b1c4304104910c4bc066cd43f9784fe2f3ddf1ad.tar.gz
abrt-b1c4304104910c4bc066cd43f9784fe2f3ddf1ad.tar.xz
abrt-b1c4304104910c4bc066cd43f9784fe2f3ddf1ad.zip
*: cast pids and uigs to long, not int
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'lib/Utils')
-rw-r--r--lib/Utils/DebugDump.cpp6
-rw-r--r--lib/Utils/daemon.cpp4
-rw-r--r--lib/Utils/xfuncs.cpp4
3 files changed, 7 insertions, 7 deletions
diff --git a/lib/Utils/DebugDump.cpp b/lib/Utils/DebugDump.cpp
index 86e198c..cb3a082 100644
--- a/lib/Utils/DebugDump.cpp
+++ b/lib/Utils/DebugDump.cpp
@@ -209,8 +209,8 @@ void CDebugDump::Lock()
error_msg_and_die("Locking bug on '%s'", m_sDebugDumpDir.c_str());
std::string lockFile = m_sDebugDumpDir + ".lock";
- char pid_buf[sizeof(int)*3 + 2];
- sprintf(pid_buf, "%u", (unsigned)getpid());
+ char pid_buf[sizeof(long)*3 + 2];
+ sprintf(pid_buf, "%lu", (long)getpid());
while ((m_bLocked = GetAndSetLock(lockFile.c_str(), pid_buf)) != true)
{
sleep(1); /* was 0.5 seconds */
@@ -267,7 +267,7 @@ void CDebugDump::Create(const char *pDir, int64_t uid)
{
/* if /var/cache/abrt is writable by all, _aborting_ here is not useful */
/* let's just warn */
- perror_msg("can't change '%s' ownership to %u:%u", m_sDebugDumpDir.c_str(), (int)uid, (int)gid);
+ perror_msg("can't change '%s' ownership to %lu:%lu", m_sDebugDumpDir.c_str(), (long)uid, (long)gid);
}
SaveText(FILENAME_UID, to_string(uid).c_str());
diff --git a/lib/Utils/daemon.cpp b/lib/Utils/daemon.cpp
index 7aa891c..0527062 100644
--- a/lib/Utils/daemon.cpp
+++ b/lib/Utils/daemon.cpp
@@ -78,12 +78,12 @@ static char *append_escaped(char *start, const char *s)
#define COMMAND_LINE_SIZE 2048
char* get_cmdline(pid_t pid)
{
- char path[sizeof("/proc/%u/cmdline") + sizeof(int)*3];
+ char path[sizeof("/proc/%lu/cmdline") + sizeof(long)*3];
char cmdline[COMMAND_LINE_SIZE];
char escaped_cmdline[COMMAND_LINE_SIZE*4 + 4];
escaped_cmdline[1] = '\0';
- sprintf(path, "/proc/%u/cmdline", (int)pid);
+ sprintf(path, "/proc/%lu/cmdline", (long)pid);
int fd = open(path, O_RDONLY);
if (fd >= 0)
{
diff --git a/lib/Utils/xfuncs.cpp b/lib/Utils/xfuncs.cpp
index 3ab3739..7ffbb2d 100644
--- a/lib/Utils/xfuncs.cpp
+++ b/lib/Utils/xfuncs.cpp
@@ -371,13 +371,13 @@ bool string_to_bool(const char *s)
void xsetreuid(uid_t ruid, uid_t euid)
{
if (setreuid(ruid, euid) != 0)
- perror_msg_and_die("can't set %cid %d", 'u', (int)ruid);
+ perror_msg_and_die("can't set %cid %lu", 'u', (long)ruid);
}
void xsetregid(gid_t rgid, uid_t egid)
{
if (setregid(rgid, egid) != 0)
- perror_msg_and_die("can't set %cid %d", 'g', (int)rgid);
+ perror_msg_and_die("can't set %cid %lu", 'g', (long)rgid);
}
uid_t getuidbyname(const char* login)