php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #78594 compile error: 'LOCK_EX' undeclared
Submitted: 2019-09-25 08:41 UTC Modified: 2019-10-20 11:56 UTC
From: catalin dot nicolescu at gmail dot com Assigned: cmb (profile)
Status: Closed Package: dbase (PECL)
PHP Version: 7.2.22 OS: Alpine Linux 3.10
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: catalin dot nicolescu at gmail dot com
New email:
PHP Version: OS:

 

 [2019-09-25 08:41 UTC] catalin dot nicolescu at gmail dot com
Description:
------------
running: make
/bin/sh /tmp/pear/temp/pear-build-defaultuserPfEDnG/dbase-7.0.0/libtool --mode=compile cc  -I. -I/tmp/pear/temp/dbase -DPHP_ATOM_INC -I/tmp/pear/temp/pear-build-defaultuserPfEDnG/dbase-7.0.0/include -I/tmp/pear/temp/pear-build-defaultuserPfEDnG/dbase-7.0.0/main -I/tmp/pear/temp/dbase -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib  -DHAVE_CONFIG_H  -g -O2   -c /tmp/pear/temp/dbase/dbf_head.c -o dbf_head.lo
mkdir .libs
 cc -I. -I/tmp/pear/temp/dbase -DPHP_ATOM_INC -I/tmp/pear/temp/pear-build-defaultuserPfEDnG/dbase-7.0.0/include -I/tmp/pear/temp/pear-build-defaultuserPfEDnG/dbase-7.0.0/main -I/tmp/pear/temp/dbase -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /tmp/pear/temp/dbase/dbf_head.c  -fPIC -DPIC -o .libs/dbf_head.o
/tmp/pear/temp/dbase/dbf_head.c: In function 'dbf_open':
/tmp/pear/temp/dbase/dbf_head.c:343:41: error: 'LOCK_EX' undeclared (first use in this function); did you mean 'CLOCK_TAI'?
  if (php_flock(fd, (o_flags == O_RDWR ? LOCK_EX : LOCK_SH))) {
                                         ^~~~~~~
                                         CLOCK_TAI
/tmp/pear/temp/dbase/dbf_head.c:343:41: note: each undeclared identifier is reported only once for each function it appears in
/tmp/pear/temp/dbase/dbf_head.c:343:51: error: 'LOCK_SH' undeclared (first use in this function); did you mean 'CLOCK_TAI'?
  if (php_flock(fd, (o_flags == O_RDWR ? LOCK_EX : LOCK_SH))) {
                                                   ^~~~~~~
                                                   CLOCK_TAI
/tmp/pear/temp/dbase/dbf_head.c:349:17: error: 'LOCK_UN' undeclared (first use in this function); did you mean 'CLOCK_TAI'?
   php_flock(fd, LOCK_UN);
                 ^~~~~~~
                 CLOCK_TAI
make: *** [Makefile:193: dbf_head.lo] Error 1
ERROR: `make' failed

Actual result:
--------------
lowest version that compiled was 7.0.0beta1

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2019-09-25 10:07 UTC] cmb@php.net
-Assigned To: +Assigned To: cmb
 [2019-09-25 10:07 UTC] cmb@php.net
Hmm, I think there needs to be

  #ifdef HAVE_SYS_FILE_H
  # include <sys/file.h>
  #endif

in dbf_head.c and dbase.c.
 [2019-10-20 11:54 UTC] cmb@php.net
-Summary: compile error +Summary: compile error: 'LOCK_EX' undeclared
 [2019-10-20 11:55 UTC] cmb@php.net
Automatic comment from SVN on behalf of cmb
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=348188
Log: Fix #78594: compile error: 'LOCK_EX' undeclared

We have to include &lt;sys/file.h&gt; if it's available.
 [2019-10-20 11:56 UTC] cmb@php.net
-Status: Assigned +Status: Closed
 [2021-04-06 10:18 UTC] git@php.net
Automatic comment on behalf of 
Revision: https://github.com/php/pecl-database-dbase/commit/e785e757858764f316d92721123b168deac1d25d
Log: Fix #78594: compile error: 'LOCK_EX' undeclared
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Dec 22 09:01:29 2024 UTC