Skip to content
Snippets Groups Projects
Commit c7008dde authored by Sebastien Ponce's avatar Sebastien Ponce
Browse files

fixes in client and make depend target for clients, according to new diagram

parent b3377983
Branches
Tags
No related merge requests found
......@@ -17,7 +17,7 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# @(#)$RCSfile: Imakefile,v $ $Revision: 1.9 $ $Release$ $Date: 2004/05/28 08:45:57 $ $Author: sponcec3 $
# @(#)$RCSfile: Imakefile,v $ $Revision: 1.10 $ $Release$ $Date: 2004/05/28 08:56:54 $ $Author: sponcec3 $
#
# Make Castor libraries and executables
#
......@@ -159,8 +159,10 @@ STGLIB_SRCS = IAddressCInt.cpp \
STGLIB_OBJS = $(STGLIB_SRCS:.cpp=.Osuf)
STAGEIN_OBJ = client/StageIn.Osuf
MTTEST_OBJ = client/Mttest.Osuf
STAGEIN_SRCS = client/StageIn.cpp
STAGEIN_OBJS = $(STAGEIN_SRCS:.cpp=.Osuf)
MTTEST_SRCS = client/Mttest.cpp
MTTEST_OBJS = $(MTTEST_SRCS:.cpp=.Osuf)
PROGS_C = ProgramTargetName(stagein) \
ProgramTargetName(mttest)
......@@ -175,8 +177,8 @@ all: $(COMMONLIB) $(PROGS_C)
SharedLibraryTarget(castorClient,$(STGLIB_OBJS),$(DEPLIB),$(LIBS))
NormalLibraryTarget(castorClient,$(STGLIB_OBJS))
NormalProgramTarget(stagein, $(STAGEIN_OBJ),$(GLOBLIB),-lcastorClient -lpthread)
NormalProgramTarget(mttest, $(MTTEST_OBJ),$(GLOBLIB),-lcastorClient -lpthread)
NormalProgramTarget(stagein, $(STAGEIN_OBJS),$(GLOBLIB),-lcastorClient -lpthread)
NormalProgramTarget(mttest, $(MTTEST_OBJS),$(GLOBLIB),-lcastorClient -lpthread)
MakeSubdirs(all,$(SUBDIRS))
MakeCondSubdirs(clean,$(SUBDIRS),)
......@@ -207,7 +209,7 @@ Makefiles:
done ;
depend:
makedepend $(INCLUDES) $(STGLIB_SRCS) 2> /dev/null
makedepend $(INCLUDES) $(STGLIB_SRCS) $(STAGEIN_SRCS) $(MTTEST_SRCS) 2> /dev/null
for i in $(DEPENDDIRS) ;\
do (if [ -d $$i ] ;\
then \
......
......@@ -122,49 +122,6 @@ void castor::client::BaseClient::parseInput(int argc, char** argv)
}
}
//------------------------------------------------------------------------------
// getDefaultDescription
//------------------------------------------------------------------------------
std::string castor::client::BaseClient::getDefaultDescription()
throw (castor::exception::Exception) {
struct utsname utsname;
if (uname(&utsname) == -1) {
castor::exception::Exception ex(errno);
ex.getMessage() << "Unable to get machine name";
throw ex;
}
uid_t uid = getuid();
errno = 0;
passwd* pwd = getpwuid(uid);
if (pwd == 0) {
castor::exception::Exception ex(errno);
ex.getMessage() << "Unable to get user name";
throw ex;
}
const time_t stime = time(0);
if (stime == -1) {
castor::exception::Exception ex(errno);
ex.getMessage() << "Unable to get time";
throw ex;
}
struct tm *t = localtime(&stime);
if (t == 0) {
castor::exception::Internal ex;
ex.getMessage() << "Unable to get local time";
throw ex;
}
std::ostringstream desc;
desc << "Request by " << pwd->pw_name
<< " on " << utsname.nodename
<< " at " << t->tm_hour
<< ":" << t->tm_min
<< ":" << t->tm_sec
<< " on " << t->tm_mon
<< "/" << t->tm_mday
<< "/" << t->tm_year;
return desc.str();
}
//------------------------------------------------------------------------------
// createClient
//------------------------------------------------------------------------------
......
......@@ -90,12 +90,6 @@ namespace castor {
*/
virtual castor::rh::Request* buildRequest() = 0;
/**
* builds a default description for a request
*/
std::string getDefaultDescription()
throw (castor::exception::Exception);
/**
* creates a Client object from the callback socket
* The caller is responsible for deallocating the
......
......@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* @(#)$RCSfile: StageIn.cpp,v $ $Revision: 1.2 $ $Release$ $Date: 2004/05/19 16:37:16 $ $Author: sponcec3 $
* @(#)$RCSfile: StageIn.cpp,v $ $Revision: 1.3 $ $Release$ $Date: 2004/05/28 08:56:54 $ $Author: sponcec3 $
*
*
*
......@@ -56,7 +56,6 @@ castor::rh::Request* castor::client::StageIn::buildRequest()
// Build request
castor::rh::StageInRequest* req =
new castor::rh::StageInRequest();
req->setDescription(getDefaultDescription());
for (std::vector<std::string>::const_iterator it = m_inputArguments.begin();
it != m_inputArguments.end();
it++) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment