largefile_support="yes"
   ;;
 hpux)
+       PSCMD="UNIX95=1 ps -e -o pid,comm"
+       CFLAGS="$(CFLAGS) -D_XOPEN_SOURCE_EXTENDED=1"
        DISTVER=`uname -r`
        TAPEDRIVE="/dev/rmt/0hnb"
   ;;
 
        largefile_support="yes"
   ;;
 hpux)
+       PSCMD="UNIX95=1 ps -e -o pid,comm"
+       CFLAGS="$(CFLAGS) -D_XOPEN_SOURCE_EXTENDED=1"
        DISTVER=`uname -r`
        TAPEDRIVE="/dev/rmt/0hnb"
   ;;
            platforms/suse/bacula-fd \
            platforms/suse/bacula-sd \
            platforms/suse/bacula-dir \
+           platforms/suse/bacula \
            platforms/suse/bacula.spec"
   ;;
 suse5)
 
      http://howtos.linux.com/guides/nag2/x-087-2-nfs.mountd.shtml
 
 For 1.33
-- Dates are wrong in restore list from Win32 FD.
-- Dates are wrong in catalog from Win32 FD.
+- Allow for optional cancelling of SD and FD in case DIR
+  gets a fatal error. Requested by Jesse Guardiani <jesse@wingnet.net>
 - Remove h_errno from bnet.c by including proper header.
 - Do not err job if could not write bootstrap file.
 - Bizarre message: Error: Could not open WriteBootstrap file:
      Differential Backup Pool = zzz
    }
 - Look at ASSERT() at 384 src/lib/bnet.c
+- Dates are wrong in restore list from Win32 FD.
+- Dates are wrong in catalog from Win32 FD.
+
 
       exit(1);
    }
    already_here = TRUE;
-   Dmsg0(000, "write_state_file\n");
    write_state_file(director->working_directory, "bacula-dir", director->DIRport);
    delete_pid_file(director->pid_directory, "bacula-dir", director->DIRport);
 // signal(SIGCHLD, SIG_IGN);          /* don't worry about children now */
 
    bsendmsg(ua, "%s Version: " VERSION " (" BDATE ") %s %s %s\n", my_name,
            HOST_OS, DISTNAME, DISTVER);
    bstrftime_nc(dt, sizeof(dt), daemon_start_time);
-   bsendmsg(ua, _("Daemon started %s, %d Job%s run.\n"), dt, last_job.NumJobs,
-        last_job.NumJobs == 1 ? "" : "s");
+   bsendmsg(ua, _("Daemon started %s, %d Job%s run.\n"), dt, last_jobs->size(),
+        last_jobs->size() == 1 ? "" : "s");
    /*
     * List scheduled Jobs
     */
 
                      &dir_workq, handle_client_request);
    }
 
-   term_msg();
+   terminate_filed(0);
    exit(0);                          /* should never get here */
 }
 
 
              HOST_OS, DISTNAME, DISTVER);
    sendit(msg, len, arg);
    bstrftime_nc(dt, sizeof(dt), daemon_start_time);
-   len = Mmsg(&msg, _("Daemon started %s, %d Job%s run.\n"), dt, last_job.NumJobs,
-        last_job.NumJobs == 1 ? "" : "s");
+   len = Mmsg(&msg, _("Daemon started %s, %d Job%s run.\n"), dt, last_jobs->size(),
+        last_jobs->size() == 1 ? "" : "s");
    sendit(msg, len, arg);
 #if defined(HAVE_CYGWIN) || defined(HAVE_WIN32)
    if (debug_level > 0) {
 
    list_terminated_jobs(sendit, arg);
 
-#ifdef xxx
-      char termstat[30];
-      struct s_last_job *je;
-      lock_last_jobs_list();
-      for (je=NULL; (je=(s_last_job *)last_jobs->next(je)); ) {
-        bstrftime_nc(dt, sizeof(dt), je->end_time);
-         len = Mmsg(&msg, _("Last Job %s finished at %s\n"), je->Job, dt);
-        sendit(msg, len, arg);
-
-        jobstatus_to_ascii(je->JobStatus, termstat, sizeof(termstat));
-         len = Mmsg(&msg, _("  Files=%s Bytes=%s Termination Status=%s\n"), 
-             edit_uint64_with_commas(je->JobFiles, b1),
-             edit_uint64_with_commas(je->JobBytes, b2),
-             termstat);
-        sendit(msg, len, arg);
-      }
-      unlock_last_jobs_list();
-#endif
-
    /*
     * List running jobs  
     */
    Dmsg0(1000, "Begin status jcr loop.\n");
    lock_jcr_chain();
-   for (njcr=NULL; (njcr=get_next_jcr(njcr)); ) {
+   foreach_jcr(njcr) {
       bstrftime_nc(dt, sizeof(dt), njcr->start_time);
       if (njcr->JobId == 0) {
          len = Mmsg(&msg, _("Director connected at: %s\n"), dt);
    struct s_last_job *je;
    const char *msg;
 
-   if (last_job.NumJobs == 0) {
+   if (last_jobs->size() == 0) {
       msg = _("No Terminated Jobs.\n"); 
       sendit(msg, strlen(msg), arg);
       return;
    sendit(msg, strlen(msg), arg);
    msg = _("======================================================================\n"); 
    sendit(msg, strlen(msg), arg);
-   for (je=NULL; (je=(s_last_job *)last_jobs->next(je)); ) {
+   foreach_dlist(je, last_jobs) {
       char JobName[MAX_NAME_LENGTH];
       char *termstat;
       char buf[1000];
    char *termstat = _("Bacula Idle");
 
    bacstat = 0;
-   if (last_job.NumJobs > 0) {
+   if (last_jobs->size() > 0) {
       switch (last_job.JobStatus) {
       case JS_Canceled:
         bacstat = -1;
 
  */
 struct s_last_job {
    dlink link;
-   int NumJobs;
+   int xNumJobs;                      /* no longer used */
    int JobType;
    int JobStatus;
    int JobLevel;
 
 
 #include "bacula.h"
 #include "jcr.h"
+#include <netdb.h>
 
 extern time_t watchdog_time;
 
 #define NO_DATA        4       /* Valid name, no data record of requested type. */
 #endif
 
-#ifndef HAVE_WIN32
-extern int h_errno;            /* On error has one of the above */
-#endif
 /*
  * Get human readable error for gethostbyname()
  */
 
    case JT_VERIFY:
    case JT_RESTORE:
    case JT_ADMIN:
-      last_job.NumJobs++;
       last_job.JobType = jcr->JobType;
       last_job.JobId = jcr->JobId;
       last_job.VolSessionId = jcr->VolSessionId;
 
    bnet_fsend(user, "\n%s Version: " VERSION " (" BDATE ") %s %s %s\n", my_name,
              HOST_OS, DISTNAME, DISTVER);
    bstrftime_nc(dt, sizeof(dt), daemon_start_time);
-   bnet_fsend(user, _("Daemon started %s, %d Job%s run.\n"), dt, last_job.NumJobs,
-        last_job.NumJobs == 1 ? "" : "s");
+   bnet_fsend(user, _("Daemon started %s, %d Job%s run.\n"), dt, last_jobs->size(),
+        last_jobs->size() == 1 ? "" : "s");
 
    /*
     * List terminated jobs
    found = 0;
    lock_jcr_chain();
    /* NOTE, we reuse a calling argument jcr. Be warned! */ 
-   for (jcr=NULL; (jcr=get_next_jcr(jcr)); ) {
+   foreach_jcr(jcr) {
       if (jcr->JobStatus == JS_WaitFD) {
          bnet_fsend(user, _("%s Job %s waiting for Client connection.\n"),
            job_type_to_str(jcr->JobType), jcr->Job);
    struct s_last_job *je;
    char *msg;
 
-   if (last_job.NumJobs == 0) {
+   if (last_jobs->size() == 0) {
       msg = _("No Terminated Jobs.\n"); 
       sendit(msg, strlen(msg), arg);
       return;
    sendit(msg, strlen(msg), arg);
    msg = _("======================================================================\n"); 
    sendit(msg, strlen(msg), arg);
-   for (je=NULL; (je=(s_last_job *)last_jobs->next(je)); ) {
+   foreach_dlist(je, last_jobs) {
       char JobName[MAX_NAME_LENGTH];
       char *termstat;
       char buf[1000];
 
 #undef  VERSION
 #define VERSION "1.33.4"
 #define VSTRING "1"
-#define BDATE   "22 Feb 2004"
-#define LSMDATE "22Feb04"
+#define BDATE   "23 Feb 2004"
+#define LSMDATE "23Feb04"
 
 /* Debug flags */
 #undef  DEBUG