[torquedev] [PATCH] Fix Torque compilation for picky compiler
Steve Snelgrove
ssnelgrove at clusterresources.com
Fri Apr 25 09:01:25 MDT 2008
Tobias,
I have applied your changes to the 2.4(trunk) version of the code.
Thanks very much for your suggestions.
Steve
$ svn commit -m"Applied patch supplied by Tobias Burnus to fix compile
problems on openSUSE."
Sending doc/soelim.c
Sending src/cmds/qdisable.c
Sending src/cmds/qenable.c
Sending src/cmds/qrun.c
Sending src/cmds/qstart.c
Sending src/cmds/qstop.c
Sending src/cmds/qterm.c
Sending src/include/md5.h
Sending src/include/mom_func.h
Sending src/include/qmgr.h
Sending src/lib/Libnet/md5.c
Sending src/lib/Libnet/net_server.c
Sending src/resmom/start_exec.c
Sending src/scheduler.cc/pbs_sched.c
Sending src/server/req_stat.c
Transmitting file data ...............
Committed revision 2108.
Tobias Burnus wrote:
> Hello,
>
> Below you find some compile fixes needed for a particularly picky
> compiler. I would be happy if you could include those in your next
> release.
>
> (If you wonder which compiler this is: It is GCC 4.3.0 with some patch
> by SUSE which checks the prototype declaration; the patch was needed to
> get Torque to build with openSUSE Factory on the build server; the
> Torque RPM packages are downloadable at
> http://software.opensuse.org/search)
>
> Thanks,
>
> Tobias
>
>
> My compiler complains when compiling Torque with the following message:
>
> |../Libnet/md5.c:146: error: call to function 'Transform' without a real
> prototype
> ../Libnet/md5.c:52: note: 'Transform' was declared here
> ../Libnet/md5.c: In function 'MD5Final':
> ../Libnet/md5.c:180: error: call to function 'Transform' without a real
> prototype
> ../Libnet/md5.c:52: note: 'Transform' was declared here
>
> which is fixed by the attached patch.| The "start_exec" part of the
> patch is to fix a sign problem. MD5Update expects unsigned char*, but
> caddr_t is "char *", which is signed.
>
> |
>
> Additionally, it complained that for freopen the return value
> was not checked; I fixed this using:
>
> **************************************
> --- ../torque-2.3.0.orig/src/scheduler.cc/pbs_sched.c 2008-03-06
> 22:29:03.000000000 +0100
> +++ ./src/scheduler.cc/pbs_sched.c 2008-04-01 18:11:58.000000000
> +0200
> @@ -981,7 +981,13 @@
>
> lock_out(lockfds, F_WRLCK);
>
> - freopen(dbfile, "a", stdout);
> + if (freopen(dbfile, "a", stdout) == NULL)
> + {
> + perror("opening lockfile");
> +
> + exit(1);
> + }
> +
>
> setvbuf(stdout, NULL, _IOLBF, 0);
>
> @@ -995,7 +1001,12 @@
> pid = getpid();
> }
>
> - freopen("/dev/null", "r", stdin);
> + if (freopen("/dev/null", "r", stdin) == NULL)
> + {
> + perror("opening /dev/null");
> +
> + exit(1);
> + }
>
> /* write scheduler's pid into lockfile */
>
> ||**************************************|
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> torquedev mailing list
> torquedev at supercluster.org
> http://www.supercluster.org/mailman/listinfo/torquedev
More information about the torquedev
mailing list