39 lines
1.3 KiB
Plaintext
39 lines
1.3 KiB
Plaintext
$OpenBSD: patch-kcontrol_clock_dtime_cpp,v 1.1 2003/01/08 09:59:07 espie Exp $
|
|
--- kcontrol/clock/dtime.cpp.orig Mon Jun 24 11:55:36 2002
|
|
+++ kcontrol/clock/dtime.cpp Wed Jan 8 09:52:58 2003
|
|
@@ -246,10 +246,19 @@ void Dtime::save()
|
|
{
|
|
KProcess c_proc;
|
|
|
|
+// BSD systems reverse year compared to Susv3
|
|
+#if defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__NetBSD__)
|
|
+ BufS.sprintf("%04d%02d%02d%02d%02d.%02d",
|
|
+ date.year(),
|
|
+ date.month(), date.day(),
|
|
+ hour->text().toInt(), minute->text().toInt(),
|
|
+ second->text().toInt());
|
|
+#else
|
|
BufS.sprintf("%02d%02d%02d%02d%04d.%02d",
|
|
date.month(), date.day(),
|
|
hour->text().toInt(), minute->text().toInt(),
|
|
date.year(), second->text().toInt());
|
|
+#endif
|
|
|
|
kdDebug() << "Set date " << BufS << endl;
|
|
|
|
@@ -257,8 +266,12 @@ void Dtime::save()
|
|
c_proc << BufS;
|
|
c_proc.start( KProcess::Block );
|
|
|
|
- if ( c_proc.exitStatus() != 0 )
|
|
- {
|
|
+ int result = c_proc.exitStatus();
|
|
+ if (result != 0
|
|
+#if defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__NetBSD__)
|
|
+ && result != 2 // can only set local date, which is okay
|
|
+#endif
|
|
+ ) {
|
|
KMessageBox::error( this, i18n("Can not set date."));
|
|
return;
|
|
}
|