OSSP CVS Repository

ossp - Ticket #111 History
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [Attach]  [Edit]  [View

Ticket 111 History: unable to build ossp js with file object

  1. Created 2006-Jul-25 11:21:52 by anonymous
  2. Added remarks:
    alfred.reibenschuh@it-austria.com
    by anonymous on 2006-Jul-25 11:52
  3. Changed remarks.
    *** 1 ****
    ! alfred.reibenschuh@it-austria.com
    --- 1,26 ----
    ! <html><pre>
    ! [root@hyperion js-1.6.20060724]# uname -a
    ! Linux hyperion.lnwm 2.6.9-22.0.2.ELsmp #1 SMP Tue Jan 17 06:12:06 CST 2006 x86_64 x86_64 x86_64 GNU/Linux
    ! 
    ! [root@hyperion js-1.6.20060724]# cat /etc/redhat-release
    ! CentOS release 4.3 (Final)
    ! 
    ! relevant installed packages:
    ! binutils-2.15.92.0.2-18
    ! cpp-3.4.5-2
    ! gcc-3.4.5-2
    ! gcc-c++-3.4.5-2
    ! glibc-2.3.4-2.19
    ! glibc-common-2.3.4-2.19
    ! glibc-devel-2.3.4-2.19
    ! glibc-headers-2.3.4-2.19
    ! glibc-kernheaders-2.4-9.1.98.EL
    ! libgcc-3.4.5-2
    ! libstdc++-3.4.5-2
    ! libstdc++-devel-3.4.5-2
    ! 
    ! 
    ! --
    ! i can be reached via: alfred.reibenschuh@it-austria.com
    ! 
    ! </pre></html>
    
    by anonymous on 2006-Jul-25 11:59
  4. Changed remarks.
    *** 22,23 ****
    --- 22,96 ----
      
    + Further inspection yields:
    + 
    + code around line 2678 looks like :
    + ----------------
    + #ifdef OSSP
    +         if (file->isOpen
    +             ? fstat(fileno(file->handle), &info) != 0
    +             : stat(file->path, &info) != 0) {
    +             JS_ReportErrorNumber(cx, JSFile_GetErrorMessage, NULL,
    +                                  JSFILEMSG_CANNOT_ACCESS_FILE_STATUS, file->path);
    +             goto out;
    +         }
    + 
    +         t = (time_t)(info.st_birthtime);
    +         tm = localtime(&t);
    +         *vp = OBJECT_TO_JSVAL(js_NewDateObject(cx, tm->tm_year + 1900,
    +                                     tm->tm_mon + 1,
    +                                     tm->tm_mday,
    +                                     tm->tm_hour,
    +                                     tm->tm_min,
    +                                     tm->tm_sec));
    + #else
    + ----------------
    + 
    + "struct stat" is defined in /usr/include/bits/stat.h without a st_birthtime member.
    + 
    + also http://lxr.mozilla.org/seamonkey/source/nsprpub/pr/src/md/unix/unix.c#2565 contains:
    + 
    + 2565 static int _MD_convert_stat_to_fileinfo(
    + 2566     const struct stat *sb,
    + 2567     PRFileInfo *info)
    + 2568 {
    + 2569     if (S_IFREG & sb->st_mode)
    + 2570         info->type = PR_FILE_FILE;
    + 2571     else if (S_IFDIR & sb->st_mode)
    + 2572         info->type = PR_FILE_DIRECTORY;
    + 2573     else
    + 2574         info->type = PR_FILE_OTHER;
    + 2575 
    + 2576 #if defined(_PR_HAVE_LARGE_OFF_T)
    + 2577     if (0x7fffffffL < sb->st_size)
    + 2578     {
    + 2579         PR_SetError(PR_FILE_TOO_BIG_ERROR, 0);
    + 2580         return -1;
    + 2581     }
    + 2582 #endif /* defined(_PR_HAVE_LARGE_OFF_T) */
    + 2583     info->size = sb->st_size;
    + 2584 
    + 2585     _MD_set_fileinfo_times(sb, info);
    + 2586     return 0;
    + 2587 }  /* _MD_convert_stat_to_fileinfo */
    + 
    + 
    + and http://lxr.mozilla.org/seamonkey/source/nsprpub/pr/src/md/unix/unix.c#2381 contains:
    + 
    + 2381 static void _MD_set_fileinfo_times(
    + 2382     const struct stat *sb,
    + 2383     PRFileInfo *info)
    + 2384 {
    + 2385     PRInt64 us, s2us;
    + 2386 
    + 2387     LL_I2L(s2us, PR_USEC_PER_SEC);
    + 2388     LL_I2L(info->modifyTime, sb->st_mtim.tv_sec);
    + 2389     LL_MUL(info->modifyTime, info->modifyTime, s2us);
    + 2390     LL_I2L(us, sb->st_mtim.tv_nsec / 1000);
    + 2391     LL_ADD(info->modifyTime, info->modifyTime, us);
    + 2392     LL_I2L(info->creationTime, sb->st_ctim.tv_sec);
    + 2393     LL_MUL(info->creationTime, info->creationTime, s2us);
    + 2394     LL_I2L(us, sb->st_ctim.tv_nsec / 1000);
    + 2395     LL_ADD(info->creationTime, info->creationTime, us);
    + 2396 }
    + 
    + 
      --
    
    by anonymous on 2006-Jul-25 12:28
  5. Changed remarks.
    *** 94,95 ****
    --- 94,117 ----
      
    + which means that the code fragment should look like:
    + ----------------
    + #ifdef OSSP
    +         if (file->isOpen
    +             ? fstat(fileno(file->handle), &info) != 0
    +             : stat(file->path, &info) != 0) {
    +             JS_ReportErrorNumber(cx, JSFile_GetErrorMessage, NULL,
    +                                  JSFILEMSG_CANNOT_ACCESS_FILE_STATUS, file->path);
    +             goto out;
    +         }
    + 
    +         t = (time_t)(info.st_ctime);
    +         tm = localtime(&t);
    +         *vp = OBJECT_TO_JSVAL(js_NewDateObject(cx, tm->tm_year + 1900,
    +                                     tm->tm_mon + 1,
    +                                     tm->tm_mday,
    +                                     tm->tm_hour,
    +                                     tm->tm_min,
    +                                     tm->tm_sec));
    + #else
    + ----------------
    + 
      
    
    by anonymous on 2006-Jul-25 12:33
  6. Change assignedto from "" to "rse" by anonymous on 2006-Jul-25 12:38
  7. Changed remarks.
    *** 1,2 ****
    --- 1,4 ----
      <html><pre>
    + Ticket #110 is a dup of this !
    + 
      [root@hyperion js-1.6.20060724]# uname -a
    
    by anonymous on 2006-Jul-25 12:38
  8. Changed remarks.
    *** 119,120 ****
    --- 119,124 ----
      
    + i also googled up a configure.ac alternative like:
    + AC_CHECK_MEMBERS([struct stat.st_birthtime])
    + 
    + 
      --
    
    by anonymous on 2006-Jul-25 12:45
  9. Changed remarks.
    *** 122,124 ****
    --- 122,126 ----
      
    + a sidenote:
      
    + shouldn't .libjs.so.0.0.0 be named .libs/libjs.so.1.6.0 ?
      --
    
    by anonymous on 2006-Jul-25 12:55
  10. Check-in [5535]: Increase portability by gracefully downgrading the stat(2) use of st_birthtime to st_birthtimensec or even st_mtime.(By rse on 2006-Jul-29 11:08)
  11. Check-in [5536]: Changed GNU libtool shared library versioning from 0:0 to 1:6(By rse on 2006-Jul-29 11:14)
  12. Check-in [5537]: use ctime(By rse on 2006-Jul-29 11:15)
  13. Change status from "new" to "fixed" by rse on 2006-Jul-29 11:15

CVSTrac 2.0.1