Commit 5384d11d authored by Seblu's avatar Seblu
Browse files

Suppression des perror residents

parent 645fd020
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -277,7 +277,7 @@ void SLDaemon::auth() {

void SLDaemon::cmd_exit() {
  //TODO: print date
  sendln("EXIT: ");
  sendln("EXIT: ok.");
  disconnect();
  exit(ERR_OK);
}
@@ -347,7 +347,7 @@ void SLDaemon::cmd_exec(const char *line) {

    // allow sun to start
    if (kill(pid, SIGCONT)) {
      perror("sld: cmd_exec");
      logerr << "sld: cmd_exec" << strerror(errno) << ".\n";
      jobs_.erase(j);
    }
  }
@@ -356,21 +356,21 @@ void SLDaemon::cmd_exec(const char *line) {
    // Wait father registration stuff before doing something else
    // so we suspend execution
    if (kill(getpid(), SIGSTOP)) {
      perror("sld: cmd_exec");
      logerr << "sld: cmd_exec" << strerror(errno) << ".\n";
      return;
    }

    // try to run job
    if (dup2(socket_fd_, STDOUT_FILENO) == -1) {
      perror(">> dup2");
      logerr << ">> dup2" << strerror(errno) << ".\n";
      exit(ERR_UNKNOWN);
    }
    if (dup2(socket_fd_, STDERR_FILENO) == -1) {
      perror(">> dup2");
      logerr << ">> dup2" << strerror(errno) << ".\n";
      exit(ERR_UNKNOWN);
    }
    execl(path.c_str(), basename(path.c_str()), 0);
    perror(string("sld: execl " + path).c_str());
    logerr << "sld: execl (" << path << "): " << strerror(errno) << ".\n";
    exit(ERR_UNKNOWN);
  }
}