On Tue, 17 Sep 2019 17:52:09 +0200
Robert Nagy <rob...@openbsd.org> wrote:

> On 17/09/19 17:05 +0200, Henry Jensen wrote:
> > Greetings,
> > 
> > I incorporated Stuart's changes and removed the remark about the clamav
> > flavor in DESCR. I tested it on -current amd64 and confirmed that it
> > builds and works as intended. 
> > 
> > Robert's approach of replacing sigtimedwait() didn't work here:
> > 
> > FatController.cpp:1700:22: error: use of undeclared identifier 
> > 'SYS___thrsigdivert'
> >         rc = syscall(SYS___thrsigdivert, signal_set, NULL, &timeout);
> > 
> > so I didn't change this (although I think his way is more elegant,
> > maybe there is something missing).
> > 
> >   
> 
> 
> $OpenBSD$
> 
> Index: src/FatController.cpp
> --- src/FatController.cpp.orig
> +++ src/FatController.cpp
> @@ -46,6 +46,10 @@
>  #include <openssl/conf.h>
>  #endif //__SSLMITM
>  
> +#if defined(__OpenBSD__)
> +#include <sys/syscall.h>
> +#endif
> +
>  #include "FatController.hpp"
>  #include "ConnectionHandler.hpp"
>  #include "DynamicURLList.hpp"
> @@ -194,7 +198,7 @@ void stat_rec::reset()
>         fprintf(fs, "%s %d      %d      %d      %d      %ld     %ld     %ld   
>    %ld    %d       %d\n", buffer, o.http_workers,
>          bc, o.http_worker_Q.size(), o.log_Q->size(), cnx, cps, rqx, rqs, 
> mfd, LC);
>      } else {
> -        fprintf(fs, "%ld       %d      %d      %d      %d      %ld     %ld   
>   %ld     %ld     %d      %d\n", now, o.http_workers,
> +        fprintf(fs, "%lld      %d      %d      %d      %d      %ld     %ld   
>   %ld     %ld     %d      %d\n", now, o.http_workers,
>          bc, o.http_worker_Q.size(), o.log_Q->size(), cnx, cps, rqx, rqs, 
> mfd, LC);
>      }
>  
> @@ -1696,7 +1700,11 @@ int fc_controlit()   //
>          }
>          timeout.tv_sec = 5;
>          timeout.tv_nsec = (long) 0;
> +#if defined(__OpenBSD__)
> +        rc = syscall(SYS___thrsigdivert, signal_set, NULL, &timeout);
> +#else
>          rc = sigtimedwait(&signal_set, NULL, &timeout);
> +#endif
>          if (rc < 0) {
>              if (errno != EAGAIN) {
>                  syslog(LOG_INFO, "%sUnexpected error from sigtimedwait() %d 
> %s", thread_id.c_str(), errno, strerror(errno));
> 
> 
> -- 
> Regards,
> Robert Nagy


Thanks. Confirmed that it builds and runs on -current amd64. Attached the 
updated port.

OK?



Attachment: e2guardian.tar.gz
Description: application/gzip

Reply via email to