Opened 8 years ago

Closed 8 years ago

#5275 closed Bug (fixed)

fix compilation on solaris

Reported by: spaam Owned by: jordan
Priority: High Milestone: 2.81
Component: libtransmission Version: 2.80+
Severity: Normal Keywords: solaris
Cc: taem@…, christian.kuehnke@…

Description

When quotactl was introduced into libT/platform.c it failed to compile on solaris.

Attachments (3)

00-fix-compilation-on-solaris-spaam.patch (2.8 KB) - added by spaam 8 years ago.
00-fix-compilation-on-solaris-spaam-v2.patch (2.9 KB) - added by spaam 8 years ago.
transmission-trunk-r14119.diff (1.3 KB) - added by godot 8 years ago.
Revised patch on top of r14119

Download all attachments as: .zip

Change History (11)

Changed 8 years ago by spaam

comment:1 Changed 8 years ago by taem

Hi,

Thanks for your patch. On lines 17, 872 please use

#elif defined(__sun)

With

#elif __sun

compiler reports warnings that __sun is not defined on systems other than Solaris.

In getquota(), file handle 'fd' should be closed before exiting from function.

comment:2 Changed 8 years ago by taem

  • Cc taem@… added

comment:3 Changed 8 years ago by spaam

Fixed that and added some starting { to the other if statements so we can avoid some ifdefs.

comment:4 Changed 8 years ago by jordan

  • Milestone None Set deleted
  • Status changed from new to assigned
  • Version 2.76 deleted

comment:5 Changed 8 years ago by jordan

  • Resolution set to fixed
  • Status changed from assigned to closed

Patch applied in r13975.

I changed the "#if sun" on line 17 to "#if defined (sun)" because the former generated an undefined reference warning on non-sun boxen.

Thanks for the patch!

comment:6 Changed 8 years ago by taem

Hi spaam,

According to http://uw714doc.sco.com/en/man/html.4/mnttab.4.html, in your patch, on line 752 should be returned 'mnt_special' instead of 'mnt_fstype'?

And on line 799 should be used 'mnt_special' instead of 'mnt_mountp'?

Thanks.

Changed 8 years ago by godot

Revised patch on top of r14119

comment:7 Changed 8 years ago by godot

  • Cc christian.kuehnke@… added
  • Milestone set to 2.81
  • Priority changed from Normal to High
  • Resolution fixed deleted
  • Status changed from closed to reopened
  • Version set to 2.80+

The fix for this problem did not work for me. I got core dumps on solaris 2.11 using a binary compiled with 64bit ABI.

On Solaris, getment does not provide memory for the mntent structure itself. You have to allocate it yourself and pass an appropriate pointer to getmntent. See http://docs.oracle.com/cd/E19082-01/819-2243/getmntent-3c/index.html

This makes checking the return values cumbersome. I have thus remove the corresponding checks from the "return" line.

comment:8 Changed 8 years ago by jordan

  • Resolution set to fixed
  • Status changed from reopened to closed

Patch applied in r14120. Thanks!

Note: See TracTickets for help on using tickets.