alternative shortcuts; cd cinelerra-5.1; patch -p1 -i alt_shortcuts.patch
[goodguy/cinelerra.git] / cinelerra-5.1 / thirdparty / src / libuuid-1.0.3.patch
1 --- ./gen_uuid_c        2023-04-06 18:59:49.376261216 -0600
2 +++ ./gen_uuid.c        2023-04-06 17:57:00.987526837 -0600
3 @@ -216,7 +216,7 @@
4         for (i = 0; i < n; i+= ifreq_size(*ifrp) ) {
5                 ifrp = (struct ifreq *)((char *) ifc.ifc_buf+i);
6                 strncpy(ifr.ifr_name, ifrp->ifr_name, IFNAMSIZ);
7 -#ifdef SIOCGIFHWADDR
8 +#if defined(SIOCGIFHWADDR) && !defined(__sun)
9                 if (ioctl(sd, SIOCGIFHWADDR, &ifr) < 0)
10                         continue;
11                 a = (unsigned char *) &ifr.ifr_hwaddr.sa_data;
12 @@ -271,11 +271,16 @@
13         THREAD_LOCAL int                state_fd = -2;
14         THREAD_LOCAL FILE               *state_f;
15         THREAD_LOCAL uint16_t           clock_seq;
16 +       struct flock                    lock;
17         struct timeval                  tv;
18         uint64_t                        clock_reg;
19         mode_t                          save_umask;
20         int                             len;
21         int                             ret = 0;
22 +       
23 +lock.l_whence = SEEK_SET;
24 +lock.l_start = 0;
25 +lock.l_len = 0;
26  
27         if (state_fd == -2) {
28                 save_umask = umask(0);
29 @@ -294,7 +299,8 @@
30         }
31         if (state_fd >= 0) {
32                 rewind(state_f);
33 -               while (flock(state_fd, LOCK_EX) < 0) {
34 +               lock.l_type = F_WRLCK;
35 +               while (fcntl(state_fd, F_SETLKW, &lock) < 0) {
36                         if ((errno == EAGAIN) || (errno == EINTR))
37                                 continue;
38                         fclose(state_f);
39 @@ -366,7 +372,8 @@
40                         fflush(state_f);
41                 }
42                 rewind(state_f);
43 -               flock(state_fd, LOCK_UN);
44 +               lock.l_type = F_UNLCK;
45 +               fcntl(state_fd, F_SETLK, &lock);
46         }
47  
48         *clock_high = clock_reg >> 32;