Source
182
182
signal(SIGUSR1, ThatsAllFolks);
183
183
signal(SIGUSR2, ThatsAllFolks);
184
184
signal(SIGTERM, ThatsAllFolks);
185
185
signal(SIGHUP, ThatsAllFolks);
186
186
if(!strcasecmp(filename, "online")){
187
187
ONLINE = 1;
188
188
tomorrowsFile = getTodaysFile(getVisDir(), tomorrowsFile, 1);
189
189
visDataFile = getTodaysFile(getVisDir(), visDataFile, 0);
190
190
timeData = fopen("/home/vis-serv-mirror/vladata/lastdata", "r");
191
191
if(timeData){
192
-
fscanf(timeData, "%ld %ld %zd", &lastMJAD, &lastTick, &lastOffset);
192
+
fscanf(timeData, "%ld %ld %lld", &lastMJAD, &lastTick, &lastOffset);
193
193
MJAD = lastMJAD;
194
194
}
195
195
gethostname(iAm, 81);
196
196
sprintf(logDataFile, "%s/connected/%s.%ld", visDataDir, iAm,
197
197
static_cast<long>(getpid()));
198
198
hostLog = fopen(logDataFile, "w");
199
199
200
200
}else{
201
201
visDataFile = filename;
202
202
ONLINE = 0;
277
277
/*
278
278
Ok here we go, first see if we have to reopen the current data file.
279
279
280
280
Need to make sure we're at the end of the file.
281
281
*/
282
282
283
283
Last_Record++;
284
284
/*free(tmTime);*/
285
285
if(timeData){
286
286
rewind(timeData);
287
-
fscanf(timeData, "%ld %ld %zd", &MJAD, &lastTick, &lastOffset);
287
+
fscanf(timeData, "%ld %ld %lld", &MJAD, &lastTick, &lastOffset);
288
288
}
289
289
if(hostLog){
290
290
rewind(hostLog);
291
-
fprintf(hostLog, "%ld %ld %zd\n", MJAD, lastTick, lastOffset);
291
+
fprintf(hostLog, "%ld %ld %lld\n", MJAD, lastTick, lastOffset);
292
292
}
293
293
/* Now we check that we're at the end of file and try again after a bit */
294
294
/* Double check there is enough data to read */
295
295
/* Get the visibility data from the file */
296
296
if(FirstRecord){
297
297
if(feedback)
298
298
printf("Fetching 0");
299
299
PhysRecord = 0;
300
300
itemsGot = fread(buffer, 2048, 1, fpVisData);
301
301
// printf("itemsGot %d %d", itemsGot, ftell(fpVisData));