2 ===================================================================
3 RCS file: /cvs/gpe/base/gpe-conf/suid.c,v
4 retrieving revision 1.54
6 --- suid.c 26 Oct 2004 15:04:22 -0000 1.54
7 +++ suid.c 28 Oct 2004 20:20:23 -0000
10 update_time_from_net (const gchar * server)
13 + if (setvbuf(nsreturn,NULL,_IONBF,0) != 0)
14 + fprintf(stderr,"gpe-conf: error setting buffer size!");
16 char *tstr = g_strdup_printf ("ntpdate -b %s", server);
19 fprintf (stderr, "failed to execute ntpdate\n");
20 + fprintf(nsreturn,"<failed>\n");
22 - else // if ok, update rtc time
23 + else /* if ok, update rtc time */
25 + fprintf(nsreturn,"<success>\n");
26 system("/sbin/hwclock --systohc");
27 system ("echo > /var/spool/at/trigger");
36 ===================================================================
37 RCS file: /cvs/gpe/base/gpe-conf/network.c,v
38 retrieving revision 1.39
39 diff -u -r1.39 network.c
40 --- network.c 26 Oct 2004 15:04:22 -0000 1.39
41 +++ network.c 28 Oct 2004 20:20:23 -0000
45 newval = gtk_editable_get_chars (GTK_EDITABLE (entry), 0, -1);
46 - suid_exec ("SDNS", newval);
48 + suid_exec ("SDNS", newval);
54 ===================================================================
55 RCS file: /cvs/gpe/base/gpe-conf/timeanddate.c,v
56 retrieving revision 1.37
57 diff -u -r1.37 timeanddate.c
58 --- timeanddate.c 23 Aug 2004 22:33:01 -0000 1.37
59 +++ timeanddate.c 28 Oct 2004 20:20:23 -0000
74 #include <sys/types.h>
76 +#include <sys/poll.h>
78 +#include <X11/Xlib.h>
82 +#include <gdk/gdkx.h>
85 #include "timeanddate.h"
87 #include <gpe/errorbox.h>
88 #include <gpe/gtkdatecombo.h>
89 #include <gpe/gpetimesel.h>
90 +#include <gpe/infoprint.h>
93 /* --- local types and constants --- */
96 gboolean refresh_time()
98 + static char str[256];
99 + struct pollfd pfd[1];
100 + gboolean ret = FALSE;
101 + Display *dpy = GDK_DISPLAY();
104 + memset(str, 0, 256);
106 + pfd[0].fd = suidinfd;
107 + pfd[0].events = (POLLIN | POLLRDNORM | POLLRDBAND | POLLPRI);
108 + while (poll(pfd, 1, 0))
110 + if (fgets (str, 255, suidin))
112 + if (strstr(str, "<success>"))
113 + gpe_popup_infoprint (dpy,
114 + _("Time adjusted from network."));
116 + gpe_error_box(_("Adjusting time from network failed."));
128 - gtk_widget_set_sensitive(self.internet,TRUE);
129 - gtk_timeout_remove(tid);
130 + gtk_widget_set_sensitive(self.internet, TRUE);
133 system (SCREENSAVER_RESET_CMD);
134 - return (trc ? TRUE : FALSE);
138 void GetInternetTime()
140 gtk_widget_set_sensitive(self.internet,FALSE);
141 suid_exec("NTPD",gtk_entry_get_text (GTK_ENTRY (GTK_COMBO (self.ntpserver)->entry)));
143 - tid = gtk_timeout_add(500,refresh_time,NULL);
145 + tid = gtk_timeout_add(500, refresh_time, NULL);