[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
gEDA-cvs: CVS update: filetool.c
User: danmc
Date: 05/02/22 17:45:14
Modified: . filetool.c task.c
Log:
a pid_t isn't always an int so cast to a long and use %ld in printf's.
Revision Changes Path
1.7 +6 -6 eda/geda/devel/geda/src/filetool.c
(In the diff below, changes in quantity of whitespace are not shown.)
Index: filetool.c
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/devel/geda/src/filetool.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -b -r1.6 -r1.7
--- filetool.c 12 Feb 2005 22:06:03 -0000 1.6
+++ filetool.c 22 Feb 2005 22:45:14 -0000 1.7
@@ -1,4 +1,4 @@
-/* $Id: filetool.c,v 1.6 2005/02/12 22:06:03 danmc Exp $ */
+/* $Id: filetool.c,v 1.7 2005/02/22 22:45:14 danmc Exp $ */
/*******************************************************************************/
/* */
@@ -241,7 +241,7 @@
Pid = getpid();
/* redirecting stdout */
- sprintf(szValue, "/%s/%s-stdout-%d", GM_TMPDIR, GM_TMPNAME, Pid);
+ sprintf(szValue, "/%s/%s-stdout-%ld", GM_TMPDIR, GM_TMPNAME, (long) Pid);
hStdOut = freopen(szValue, "w", stdout);
if (hStdOut == NULL)
{
@@ -249,7 +249,7 @@
}
/* redirecting stderr */
- sprintf(szValue, "/%s/%s-stderr-%d", GM_TMPDIR, GM_TMPNAME, Pid);
+ sprintf(szValue, "/%s/%s-stderr-%ld", GM_TMPDIR, GM_TMPNAME, (long) Pid);
hStdErr = freopen(szValue, "w", stderr);
if (hStdErr == NULL)
{
@@ -279,7 +279,7 @@
else
{
/* print stderr */
- sprintf(szValue, "/%s/%s-stderr-%d", GM_TMPDIR, GM_TMPNAME, Pid);
+ sprintf(szValue, "/%s/%s-stderr-%ld", GM_TMPDIR, GM_TMPNAME, (long) Pid);
hStdErr = fopen(szValue, "r");
if (hStdErr == NULL)
{
@@ -308,7 +308,7 @@
}
/* remove last stdout file */
- sprintf(szValue, "/%s/%s-stdout-%d", GM_TMPDIR, GM_TMPNAME, Pid);
+ sprintf(szValue, "/%s/%s-stdout-%ld", GM_TMPDIR, GM_TMPNAME, (long) Pid);
iResult = remove(szValue);
if (iResult != 0)
{
@@ -316,7 +316,7 @@
}
/* remove last stderr file */
- sprintf(szValue, "/%s/%s-stderr-%d", GM_TMPDIR, GM_TMPNAME, Pid);
+ sprintf(szValue, "/%s/%s-stderr-%ld", GM_TMPDIR, GM_TMPNAME, (long) Pid);
iResult = remove(szValue);
if (iResult != 0)
{
1.6 +3 -3 eda/geda/devel/geda/src/task.c
(In the diff below, changes in quantity of whitespace are not shown.)
Index: task.c
===================================================================
RCS file: /home/cvspsrv/cvsroot/eda/geda/devel/geda/src/task.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- task.c 12 Feb 2005 22:06:03 -0000 1.5
+++ task.c 22 Feb 2005 22:45:14 -0000 1.6
@@ -1,4 +1,4 @@
-/* $Id: task.c,v 1.5 2005/02/12 22:06:03 danmc Exp $ */
+/* $Id: task.c,v 1.6 2005/02/22 22:45:14 danmc Exp $ */
/*******************************************************************************/
/* */
@@ -189,7 +189,7 @@
return;
szTmpFile = (char *) malloc(strlen(GM_TMPDIR) + strlen(GM_TMPNAME) + 64);
- sprintf(szTmpFile, "/%s/%s-stderr-%d", GM_TMPDIR, GM_TMPNAME, pTask->Id);
+ sprintf(szTmpFile, "/%s/%s-stderr-%ld", GM_TMPDIR, GM_TMPNAME, (long) pTask->Id);
hStdErr = fopen(szTmpFile, "r");
if (hStdErr == NULL)
{
@@ -257,7 +257,7 @@
else if (pTask->Id == 0)
{
szTmpFile = (char *) malloc(strlen(GM_TMPDIR) + strlen(GM_TMPNAME) + 64);
- sprintf(szTmpFile, "/%s/%s-stderr-%d", GM_TMPDIR, GM_TMPNAME, getpid());
+ sprintf(szTmpFile, "/%s/%s-stderr-%ld", GM_TMPDIR, GM_TMPNAME, (long) getpid());
hStdErr = freopen(szTmpFile, "w", stderr);
free(szTmpFile);
if (hStdErr == NULL)