~ubuntu-branches/ubuntu/raring/python-scipy/raring-proposed

« back to all changes in this revision

Viewing changes to Lib/xplt/src/play/unix/usernm.c

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2007-01-07 14:12:12 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20070107141212-mm0ebkh5b37hcpzn
* Remove build dependency on python-numpy-dev.
* python-scipy: Depend on python-numpy instead of python-numpy-dev.
* Package builds on other archs than i386. Closes: #402783.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * usernm.c -- $Id: usernm.c,v 1.1 2003/03/08 15:26:48 travo Exp $
3
 
 * p_getuser for UNIX machines
4
 
 *
5
 
 * Copyright (c) 1998.  See accompanying LEGAL file for details.
6
 
 */
7
 
 
8
 
#ifndef _POSIX_SOURCE
9
 
#define _POSIX_SOURCE 1
10
 
#endif
11
 
 
12
 
#include "config.h"
13
 
#include "play.h"
14
 
 
15
 
#ifndef NO_PASSWD
16
 
 
17
 
#include <sys/types.h>
18
 
#include <unistd.h>
19
 
#include <pwd.h>
20
 
 
21
 
char *
22
 
p_getuser(void)
23
 
{
24
 
  char *user = getlogin();
25
 
  if (!user) {
26
 
    struct passwd *pw = getpwuid(getuid());  /* see also pathnm.c */
27
 
    if (pw) user = pw->pw_name;
28
 
  }
29
 
  return user;
30
 
}
31
 
 
32
 
#else
33
 
 
34
 
extern char *cuserid(char *);
35
 
char *
36
 
p_getuser(void)
37
 
{
38
 
  char *user = cuserid((char *)0);
39
 
  return user;
40
 
}
41
 
 
42
 
#endif