- Fix to various drivers due to changes in rs232controller
- hkl now searches psi in .5 steps - first point of fastscan is driven normally SKIPPED: psi/amor2t.c psi/amor2t.h psi/amor2t.i psi/amor2t.tex psi/amor2t.w psi/dornier2.c psi/el734hp.c psi/nxamor.c psi/slsmagnet.c psi/sps.c
This commit is contained in:
@@ -47,24 +47,18 @@ OUTPUT PARAMETERS (Nsum, psum, p2sum,currentCount)
|
||||
STATE PARAMETERS (x,y,z,vx,vy,vz,t,s1,s2,p)
|
||||
SHARE
|
||||
%{
|
||||
#include <fcntl.h>
|
||||
void dumpTotal(char *ffilename, long totalCounts){
|
||||
FILE *fd = NULL;
|
||||
struct flock fl;
|
||||
|
||||
fl.l_type = F_WRLCK;
|
||||
fl.l_whence = 0;
|
||||
fl.l_start = 0;
|
||||
fl.l_len = 0;
|
||||
fl.l_pid = getpid();
|
||||
|
||||
fd = fopen(ffilename,"w");
|
||||
char tmp[1024];
|
||||
|
||||
strncpy(tmp,ffilename, 1000);
|
||||
strcat(tmp,"tmp");
|
||||
fd = fopen(tmp,"w");
|
||||
if(fd != NULL){
|
||||
fcntl(fileno(fd),F_SETLKW,&fl);
|
||||
fprintf(fd,"%ld\n",totalCounts);
|
||||
fl.l_type = F_UNLCK;
|
||||
fcntl(fileno(fd),F_SETLK,&fl);
|
||||
fclose(fd);
|
||||
rename(tmp,ffilename);
|
||||
unlink(tmp);
|
||||
}
|
||||
}
|
||||
%}
|
||||
|
||||
Reference in New Issue
Block a user