Installing products with SPM as root accidentally deletes device /dev/null

Article ID: 836
Last updated: 05 Feb, 2008
Article ID: 836
Last updated: 05 Feb, 2008
Revision: 1
Views: 4276
Posted: 28 Aug, 1997
by Dean J.
Updated: 05 Feb, 2008
by Dean J.
Problem


/dev/null is deleted after building Threads.h++. It can also occur with Net.h++, Inter.Net.h++, or zApp.


Cause


The makefile for Threads.h++ contains this command (solaris may be replaced with any operating system):

Templates.solaris: $(OBJECTS)
@echo Compiling Templates instantiated within Threads.h++ ...
@echo IGNORE UNDEFINED SYMBOL ERRORS!
-$(CPP) $(SPECIAL) $(CPPFLAGS) -o /dev/null $(OBJECTS)
$(TOUCH) $@

which tries to execute this command:

CC -DRW_THR_BUILD -I../../../../src -Ispm/workspaces/SOLARIS/SUNPRO -DRW_MULTI_THREAD -D_REENTRANT -mt -o /dev/null barrier.o cancel.o cblistb.o cbmlistb.o condtion.o critical.o escrob.o escroimp.o except.o fifomtx.o functor0.o grdrnblq.o handbody.o mutex.o pcbase.o prodinfo.o rnbltrap.o runfunc.o runnable.o rwlock.o semaphor.o server.o srvpool.o static.o synch.o thrattr.o threadid.o thrfunc.o thrutil.o thread.o thrmgr.o trace.o util.o variant.o version.o

If the $(CPP) command in this target fails, the compiler will attempt to clean up after this failure. Part of this clean-up is to remove the partially-created output file. This clean-up step is typical, normal behavior for compilers and linkers. Unfortunately, the output file in this case is /dev/null, and so if root is performing the make, /dev/null will be blown away.


Action


The following file will need to be edited:

Threads.h++: ./thr0111u/source/etc/UNIX/makefile.in
Look for this (solaris may be replaced with any operating system):

 Templates.solaris: $(OBJECTS)
@echo Compiling Templates instantiated within Threads.h++ ...
@echo IGNORE UNDEFINED SYMBOL ERRORS!
-$(CPP) $(SPECIAL) $(CPPFLAGS) -o /dev/null $(OBJECTS)
$(TOUCH) $@

and change it to this:

  TMPFILE=/tmp/templates.tmp    Templates.solaris: $(OBJECTS)       @echo Compiling Templates instantiated within Threads.h++ ...       @echo IGNORE UNDEFINED SYMBOL ERRORS!       -$(CPP) $(SPECIAL) $(CPPFLAGS) -o $(TMPFILE) $(OBJECTS)
-$(RM) $(TMPFILE)
$(TOUCH) $@

This also applies to the following products: Net.h++, Inter.Net.h++, zApp.

This article was:   Helpful | Not helpful
Report an issue
Article ID: 836
Last updated: 05 Feb, 2008
Revision: 1
Views: 4276
Posted: 28 Aug, 1997 by Dean J.
Updated: 05 Feb, 2008 by Dean J.

Others in this category