strncmp() returns zero for equality. Now the user can choose to proceed.
[AROS.git] / rom / dos / setowner.c
blob7f8e4aa4e0c586cfe3725d16146929937ab83cd1
1 /*
2 Copyright © 1995-2013, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: Set the owner of a file.
6 Lang: English
7 */
8 #include <aros/debug.h>
9 #include <proto/exec.h>
10 #include <dos/dosextens.h>
11 #include <proto/dos.h>
12 #include "dos_intern.h"
14 /*****************************************************************************
16 NAME */
17 #include <proto/dos.h>
19 AROS_LH2(BOOL, SetOwner,
21 /* SYNOPSIS */
22 AROS_LHA(STRPTR, name, D1),
23 AROS_LHA(ULONG, owner_info, D2),
25 /* LOCATION */
26 struct DosLibrary *, DOSBase, 166, Dos)
28 /* FUNCTION
30 INPUTS
31 name - name of the file
32 owner_info - (UID << 16) + GID
34 RESULT
35 != 0 if all went well, 0 else. IoErr() gives additional
36 information in that case.
38 NOTES
40 EXAMPLE
42 BUGS
44 SEE ALSO
46 INTERNALS
48 *****************************************************************************/
50 AROS_LIBFUNC_INIT
52 struct PacketHelperStruct phs;
53 LONG status = DOSFALSE;
55 D(bug("[SetOwner] '%s' %x\n", name, owner_info));
57 if (getpacketinfo(DOSBase, name, &phs)) {
58 status = dopacket4(DOSBase, NULL, phs.port, ACTION_SET_OWNER, (IPTR)NULL, phs.lock, phs.name, (IPTR)owner_info);
59 freepacketinfo(DOSBase, &phs);
62 return status;
64 AROS_LIBFUNC_EXIT
65 } /* SetOwner */