Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 24914 - bug in gnewspost source with errno and tmpnam fixed
Summary: bug in gnewspost source with errno and tmpnam fixed
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: Keychain (show other bugs)
Hardware: All Linux
: High blocker
Assignee: Lisa Seelye (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 23597
  Show dependency tree
 
Reported: 2003-07-20 13:16 UTC by Daniel Albuschat
Modified: 2003-08-02 07:53 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
source diff (session.c.diff,292 bytes, patch)
2003-07-20 13:18 UTC, Daniel Albuschat
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Albuschat 2003-07-20 13:16:56 UTC
I dunno why they did it, but they decleared an own errno as "extern int errno" but
didn't define it.
I deleted that line and included <errno.h>.
The other fix is that I followed my compilers thoughts and replaced the tmpnam
function
call with mkstemp.

Reproducible: Always
Steps to Reproduce:
1. emerge gnewspost
Actual Results:  
I get a linker error about errno

Expected Results:  
compile :)

Here is the diff of the file src/session.c:

38a39
> #include <errno.h>
45,46d45
< extern int errno;
< 
440c439
<       gchar *fname, *txt;
---
>       gchar *fname = "tmpgnewspostXXXXXX", *txt;
450,451c449,450
<       fname = g_strdup(tmpnam(NULL));
<       if ((fd = open(fname, O_WRONLY|O_CREAT)) == -1) {
---
>       fd = mkstemp(fname);
>       if( fd == -1 ) {
Comment 1 Daniel Albuschat 2003-07-20 13:18:06 UTC
Created attachment 14784 [details, diff]
source diff

Nothing much done, but it doesn't compile without the patch.
Comment 2 Lisa Seelye (RETIRED) gentoo-dev 2003-08-02 07:41:30 UTC
i'll get this for bugday and bug 23597
Comment 3 Lisa Seelye (RETIRED) gentoo-dev 2003-08-02 07:53:02 UTC
This is in CVS, thanks for the diff, have you sent it upstream?