summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormarco <marco@3ad0048d-3df7-0310-abae-a5850022a9f2>2008-05-25 09:45:50 +0000
committermarco <marco@3ad0048d-3df7-0310-abae-a5850022a9f2>2008-05-25 09:45:50 +0000
commit4aefa0b673e38beaef7291ecf52fcdeb579e26c2 (patch)
tree65293e24dc706e6c2923a090e67e3391c111cbc9
parent435bacbce25c525f719a8a674ee0109371c5d1eb (diff)
downloadfpc-4aefa0b673e38beaef7291ecf52fcdeb579e26c2.tar.gz
* Little FreeBSD fixes.
git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@11082 3ad0048d-3df7-0310-abae-a5850022a9f2
-rw-r--r--packages/users/examples/testpass2.pp17
1 files changed, 12 insertions, 5 deletions
diff --git a/packages/users/examples/testpass2.pp b/packages/users/examples/testpass2.pp
index 1d15d0a008..7f843f5feb 100644
--- a/packages/users/examples/testpass2.pp
+++ b/packages/users/examples/testpass2.pp
@@ -1,6 +1,8 @@
Program TestPass2;
-Uses pwd,grp,baseunix;
+Uses pwd,grp,baseunix,sysutils;
+
+{$mode objfpc}{$h+}
Procedure printpchar(fieldname:String;p:pchar);
@@ -13,11 +15,16 @@ Begin
End;
End;
+Procedure printpchar(fieldname,p:string);
+
+Begin
+ printpchar(fieldname,pchar(p));
+End;
+
Var p : PPasswd;
supplementary_gids : array[0..99] Of gid_t;
i,nrgids: cint;
pgrp: PGroup;
-
Begin
p := fpgetpwnam('marcov');
If assigned(p) Then
@@ -27,15 +34,15 @@ Begin
writeln('pw_uid:',' ':9,p^.pw_uid);
writeln('pw_gid:',' ':9,p^.pw_gid);
{$ifdef BSD}
- printpchar('pw_change',p^.pw_change);
+ printpchar('pw_change',inttostr(p^.pw_change));
printpchar('pw_class',p^.pw_class);
{$endif}
printpchar('pw_gecos',p^.pw_gecos);
printpchar('pw_dir',p^.pw_dir);
printpchar('pw_shell',p^.pw_shell);
{$ifdef BSD}
- printpchar('pw_expire',p^.pw_expire);
- printpchar('pw_fields',p^.pw_fields);
+ printpchar('pw_expire',inttostr(p^.pw_expire));
+ printpchar('pw_fields',inttostr(p^.pw_fields));
{$endif}
End;
nrgids := 100;