Issue 4551 - OO 1.0 uses undocument statfs call, cannot add fonts, and cannot save documents in "openoffice.org 1.0 text" format
Summary: OO 1.0 uses undocument statfs call, cannot add fonts, and cannot save documen...
Status: CLOSED DUPLICATE of issue 2418
Alias: None
Product: General
Classification: Code
Component: code (show other issues)
Version: OOo 1.0.0
Hardware: Sun Solaris
: P1 (highest) Trivial (vote)
Target Milestone: ---
Assignee: hennes.rohling
QA Contact: issues@framework
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-05-06 14:20 UTC by jkeil
Modified: 2003-03-11 17:55 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description jkeil 2002-05-06 14:20:50 UTC
When adding fonts to openoffice 1.0 using spadmin, the copy
operation always fails with an error message

  Die Schriftdatei 
  /home/OpenOffice.org.1.0/share/fonts/truetype/albanyic.ttf
  konnte nicht kopiert werden.  Die Schrift wird nicht installiert.

(translated to english: cannot copy font /home/...  the font was
not installed)


Running truss agains "spadmin" reveals a failed (error = EINVAL)
"statfs" system call:


# truss -t statfs,statvfs -p `pgrep spadmin`
    Received signal #14, SIGALRM, in lwp_sema_wait() [caught]
statfs("/home/OpenOffice.org1.0/share/fonts/truetype", 0x0803FA88, 44,
134478672) Err#22 EINVAL


Note that solaris provides a "statvfs" system call, and not a "statfs"
call!  statfs() may exist in the system's libc.so, but it's
undocumented and should not be used.


		--------------------

Apparently the statvfs() vs. statfs() also causes other problems on
solaris: you cannot save text files in "OpenOffice.org 1.0" file
format.  A save operation fails with the error message:

    Fehler beim Speichern des Dokuments unbekannt1:
    Nichtexistierendes Object:
    Die Datei existiert nicht

Repeat by: start OO 1.0 on solaris.  An empty text document appears.
Try to save this empty document using the "OpenOffice.org 1.0
Textdocument" format.

		--------------------

The bug was introduced by rev 1.51.2.4 of the file sal/osl/unx/file.c
("statfs patches for IRIX")

cvs diff -r1.51.2.3 -r1.51.2.4  file.c | more
Index: file.c
===================================================================
RCS file: /cvs/oo/porting/sal/osl/unx/file.c,v
retrieving revision 1.51.2.3
retrieving revision 1.51.2.4
diff -u -B -r1.51.2.3 -r1.51.2.4
--- file.c      2002/04/17 09:05:28     1.51.2.3
+++ file.c      2002/04/23 13:15:20     1.51.2.4

....

 #if defined(SOLARIS)
 #define __OSL_STATFS statvfs
+#define __OSL_STATFS_FUNC statfs
 

This __OSL_STATFS_FUNC define breaks Solaris. __OSL_STATFS_FUNC must
be defined as "statvfs" for solaris.


		--------------------

The following patch fixes the problem:

% cvs diff
Index: file.c
===================================================================
RCS file: /cvs/oo/porting/sal/osl/unx/file.c,v
retrieving revision 1.51.2.4
diff -u -B -r1.51.2.4 file.c
--- file.c      2002/04/23 13:15:20     1.51.2.4
+++ file.c      2002/05/06 13:17:46
@@ -2207,7 +2207,7 @@
 
 #if defined(SOLARIS)
 #define __OSL_STATFS statvfs
-#define __OSL_STATFS_FUNC statfs
+#define __OSL_STATFS_FUNC statvfs
 
 #define __OSL_STATFS_BLKSIZ(a) ((sal_uInt64)((a).f_frsize))
 #define __OSL_STATFS_BLKFREE(a) ((sal_uInt64)((a).f_bavail))
Comment 1 thorsten.martens 2002-05-06 15:44:34 UTC
TM->US: Seems to be more a font-problem than a framework issue to me.
Please have a look at it. Thanks !
Comment 2 jkeil 2002-05-06 17:03:40 UTC
Hmm, the fonts are OK.

And the font installer apparently gets confused by the fact that the
osl_getVolumeInformation() / osl_psz_getVolumeInformation() function
always returns an error on solaris - because of the invalid use of
the statfs() system call inside osl_psz_getVolumeInformation().

And probably each and every place in the OO source that needs a
working osl_getVolumeInformation() is confused as well. One example
was the second problem I mentiond: saving an empty text document
in "openoffice.org 1.0 text format".

Comment 3 ulf.stroehler 2002-05-07 11:14:14 UTC
US->PL: is this something we already know?
Comment 4 philipp.lohmann 2002-05-07 13:02:12 UTC
Actually this has nothing to do with fonts. HRO can tell us more about
this. BTW: statfs is a backwards compatibility wrapper for statvfs on
Solaris.
Comment 5 philipp.lohmann 2002-05-07 13:03:14 UTC
pl->hro: i think this may be a duplicate or already fixed ?
Comment 6 hennes.rohling 2002-05-07 13:07:15 UTC
statfs Patch for IRIX contained an error. With the last fix for 
#2418 statvfs is used on solaris.

*** This issue has been marked as a duplicate of 2418 ***
Comment 7 michael.bemmer 2003-03-11 17:17:42 UTC
As mentioned on the qa dev list on March 5th I will close all resolved duplicate
issues. Please see this posting for details. First step in IssueZilla is
unfortunately to set them to verified.
Comment 8 michael.bemmer 2003-03-11 17:55:53 UTC
As mentioned on the qa dev list on March 5th I will close all resolved duplicate
issues. Please see this posting for details.