/*
* virnetsocket.c: generic network socket handling
*
- * Copyright (C) 2006-2011 Red Hat, Inc.
+ * Copyright (C) 2006-2012 Red Hat, Inc.
* Copyright (C) 2006 Daniel P. Berrange
*
* This library is free software; you can redistribute it and/or
virNetSocketPtr sock;
int no_slow_start = 1;
- VIR_DEBUG("localAddr=%p remoteAddr=%p fd=%d errfd=%d pid=%d",
+ VIR_DEBUG("localAddr=%p remoteAddr=%p fd=%d errfd=%d pid=%lld",
localAddr, remoteAddr,
- fd, errfd, pid);
+ fd, errfd, (long long) pid);
if (virSetCloseExec(fd) < 0) {
virReportSystemError(errno, "%s",
sock->client = isClient;
PROBE(RPC_SOCKET_NEW,
- "sock=%p refs=%d fd=%d errfd=%d pid=%d localAddr=%s, remoteAddr=%s",
- sock, sock->refs, fd, errfd,
- pid, NULLSTR(sock->localAddrStr), NULLSTR(sock->remoteAddrStr));
+ "sock=%p refs=%d fd=%d errfd=%d pid=%lld localAddr=%s, remoteAddr=%s",
+ sock, sock->refs, fd, errfd, (long long) pid,
+ NULLSTR(sock->localAddrStr), NULLSTR(sock->remoteAddrStr));
return sock;
#include "virpidfile.h"
#include "buf.h"
#include "ignore-value.h"
-#include "verify.h"
#define VIR_FROM_THIS VIR_FROM_NONE
virReportErrorHelper(VIR_FROM_NONE, code, __FILE__, \
__FUNCTION__, __LINE__, __VA_ARGS__)
-/* We have quite a bit of changes to make if this doesn't hold. */
-verify(sizeof(pid_t) <= sizeof(int));
-
/* Flags for virExecWithHook */
enum {
VIR_EXEC_NONE = 0,
if (cmd->pid != -1) {
virCommandError(VIR_ERR_INTERNAL_ERROR,
- _("command is already running as pid %d"),
- cmd->pid);
+ _("command is already running as pid %lld"),
+ (long long) cmd->pid);
return -1;
}
int status;
if (pid <= 0) {
- virReportSystemError(EINVAL, _("unable to wait for process %d"), pid);
+ virReportSystemError(EINVAL, _("unable to wait for process %lld"),
+ (long long) pid);
return -1;
}
errno == EINTR);
if (ret == -1) {
- virReportSystemError(errno, _("unable to wait for process %d"), pid);
+ virReportSystemError(errno, _("unable to wait for process %lld"),
+ (long long) pid);
return -1;
}
if (status != 0) {
char *st = virCommandTranslateStatus(status);
virCommandError(VIR_ERR_INTERNAL_ERROR,
- _("Child process (%d) status unexpected: %s"),
- pid, NULLSTR(st));
+ _("Child process (%lld) status unexpected: %s"),
+ (long long) pid, NULLSTR(st));
VIR_FREE(st);
return -1;
}
}
}
}
- VIR_DEBUG("failed to reap child %d, abandoning it", pid);
+ VIR_DEBUG("failed to reap child %lld, abandoning it", (long long) pid);
cleanup:
VIR_FREE(tmp);