From 76984653b4a6238feba1b50c77355ffd9974c04a Mon Sep 17 00:00:00 2001 From: Pascal Stumpf Date: Sat, 11 Aug 2012 14:01:14 +0200 Subject: [PATCH] OpenBSD patches for dtpdmd and dtprintinfo. Casts, #ifdefs, SIGCLD ... --- cde/programs/dtpdmd/manager.c | 2 +- cde/programs/dtprintinfo/UI/DtApp.C | 12 ++++++------ cde/programs/dtprintinfo/UI/DtPrinterIcon.C | 2 +- cde/programs/dtprintinfo/UI/DtPrinterIcon.h | 2 +- cde/programs/dtprintinfo/libUI/BaseUI.h | 2 +- cde/programs/dtprintinfo/objects/BaseObj.h | 2 +- .../dtprintinfo/objects/PrintObj/ParseJobs.C | 4 ++-- cde/programs/dtprintinfo/util/Invoke.C | 2 ++ 8 files changed, 15 insertions(+), 13 deletions(-) diff --git a/cde/programs/dtpdmd/manager.c b/cde/programs/dtpdmd/manager.c index 55af0458..1893f5d1 100644 --- a/cde/programs/dtpdmd/manager.c +++ b/cde/programs/dtpdmd/manager.c @@ -425,7 +425,7 @@ void mgr_launch_pdm( XpPdmServiceRec *rec ) sigemptyset(&svec.sa_mask); svec.sa_flags = 0; svec.sa_handler = SIG_DFL; - (void) sigaction(SIGCLD, &svec, (struct sigaction *) NULL); + (void) sigaction(SIGCHLD, &svec, (struct sigaction *) NULL); for (i=3; i < FOPEN_MAX; i++) { if ((i != rec->message_pipe[1]) && diff --git a/cde/programs/dtprintinfo/UI/DtApp.C b/cde/programs/dtprintinfo/UI/DtApp.C index 94bc4238..a93fbdad 100644 --- a/cde/programs/dtprintinfo/UI/DtApp.C +++ b/cde/programs/dtprintinfo/UI/DtApp.C @@ -324,16 +324,16 @@ void DtApp::SaveYourSelf() save_state = true; - char *value = window->setPrefD->ShowOnlyMyJobs() ? "1" : "0"; + char *value = window->setPrefD->ShowOnlyMyJobs() ? (char *)"1" : (char *)"0"; Save("ShowOnlyMine", value); - value = window->setPrefD->ShowStatusLine() ? "1" : "0"; + value = window->setPrefD->ShowStatusLine() ? (char *)"1" : (char *)"0"; Save("ShowMessageLine", value); - value = window->setPrefD->ShowDetailsLabel() ? "1" : "0"; + value = window->setPrefD->ShowDetailsLabel() ? (char *)"1" : (char *)"0"; Save("ShowDetailsLabel", value); - value = window->setPrefD->ShowStatusFlags() ? "1" : "0"; + value = window->setPrefD->ShowStatusFlags() ? (char *)"1" : (char *)"0"; Save("ShowProblemFlag", value); char interval[9]; @@ -357,10 +357,10 @@ void DtApp::SaveYourSelf() queues = (DtPrinterIcon **) window->container->Children(); for (i = 0; i < window->container->NumChildren(); i++) { - value = queues[i]->Visible() ? "1" : "0"; + value = queues[i]->Visible() ? (char *)"1" : (char *)"0"; sprintf(attribute, "%s.Visible", queues[i]->QueueObj()->Name()); Save(attribute, value); - value = queues[i]->Open() ? "1" : "0"; + value = queues[i]->Open() ? (char *)"1" : (char *)"0"; sprintf(attribute, "%s.Open", queues[i]->QueueObj()->Name()); Save(attribute, value); } diff --git a/cde/programs/dtprintinfo/UI/DtPrinterIcon.C b/cde/programs/dtprintinfo/UI/DtPrinterIcon.C index a0e593d7..b2a97857 100644 --- a/cde/programs/dtprintinfo/UI/DtPrinterIcon.C +++ b/cde/programs/dtprintinfo/UI/DtPrinterIcon.C @@ -174,7 +174,7 @@ char *DtPrinterIcon::Description() sprintf(buf, "%s_Print", queue->Name()); char *desc = DtActionDescription(buf); - return (desc ? desc : ""); + return (desc ? desc : (char *)""); } void DtPrinterIcon::PrintQueueUp(boolean _flag) diff --git a/cde/programs/dtprintinfo/UI/DtPrinterIcon.h b/cde/programs/dtprintinfo/UI/DtPrinterIcon.h index 82780c34..e5d5b4c0 100644 --- a/cde/programs/dtprintinfo/UI/DtPrinterIcon.h +++ b/cde/programs/dtprintinfo/UI/DtPrinterIcon.h @@ -59,7 +59,7 @@ class DtPrinterContainer : public Container : Container(category, parent, name, SCROLLED_HORIZONTAL_ROW_COLUMN) { } ~DtPrinterContainer() { delete dnd; } - boolean DtPrinterContainer::SetVisiblity(boolean flag) + boolean SetVisiblity(boolean flag) { Container::SetVisiblity(flag); dnd->UpdateActivity(flag); diff --git a/cde/programs/dtprintinfo/libUI/BaseUI.h b/cde/programs/dtprintinfo/libUI/BaseUI.h index f02c903b..0a83a9f8 100644 --- a/cde/programs/dtprintinfo/libUI/BaseUI.h +++ b/cde/programs/dtprintinfo/libUI/BaseUI.h @@ -40,7 +40,7 @@ #define boolean boolean_t #define true B_TRUE #define false B_FALSE -#elif defined(linux) +#elif defined(linux) || defined(CSRG_BASED) #define false 0 #define true 0 #define boolean int diff --git a/cde/programs/dtprintinfo/objects/BaseObj.h b/cde/programs/dtprintinfo/objects/BaseObj.h index 1b7a6e3e..7925eec8 100644 --- a/cde/programs/dtprintinfo/objects/BaseObj.h +++ b/cde/programs/dtprintinfo/objects/BaseObj.h @@ -41,7 +41,7 @@ #define boolean boolean_t #define true B_TRUE #define false B_FALSE -#elif defined(linux) +#elif defined(linux) || defined(CSRG_BASED) #define false 0 #define true 0 #define boolean int diff --git a/cde/programs/dtprintinfo/objects/PrintObj/ParseJobs.C b/cde/programs/dtprintinfo/objects/PrintObj/ParseJobs.C index 71c756b9..7a32fdf1 100644 --- a/cde/programs/dtprintinfo/objects/PrintObj/ParseJobs.C +++ b/cde/programs/dtprintinfo/objects/PrintObj/ParseJobs.C @@ -774,7 +774,7 @@ void LocalPrintJobs(char *printer, char **return_job_list, int *return_n_jobs) } #endif // HP LOCAL PARSER -#if defined(__osf__) || defined(linux) +#if defined(__osf__) || defined(linux) || defined(CSRG_BASED) // // DEC/OSF1 PARSER - Output from "lpstat -o // @@ -870,7 +870,7 @@ void LocalPrintJobs(char *printer, char **return_job_list, int *return_n_jobs) #if defined(__osf__) sprintf(buf, "lpstat -o%s", printer); #endif -#if defined(linux) +#if defined(linux) || defined(CSRG_BASED) sprintf(buf, "lpq -P%s", printer); #endif diff --git a/cde/programs/dtprintinfo/util/Invoke.C b/cde/programs/dtprintinfo/util/Invoke.C index 590adb7c..838009fe 100644 --- a/cde/programs/dtprintinfo/util/Invoke.C +++ b/cde/programs/dtprintinfo/util/Invoke.C @@ -38,7 +38,9 @@ #include #include #include +#if !defined(CSRG_BASED) #include +#endif #ifdef _AIX #include /* need to get bzero defined */ #endif /* _AIX */ -- 2.25.1