X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=etc%2Fafpd%2Fdesktop.c;h=eda917b10f69e853c504ab5496fe86222dc06fd8;hb=b0bcb8f6b0571592a50ce039882c9319e012a270;hp=369b4aaa4ab7b8bc5d0ae11c71a7a12513726799;hpb=a2a14b017e89224e9c0b6ff94f2b781244d32a7a;p=netatalk.git diff --git a/etc/afpd/desktop.c b/etc/afpd/desktop.c index 369b4aaa..eda917b1 100644 --- a/etc/afpd/desktop.c +++ b/etc/afpd/desktop.c @@ -21,18 +21,16 @@ #include #include #include -#include -#include +#include + #include -#include -#include #include #include #include +#include #include "volume.h" #include "directory.h" #include "fork.h" -#include "globals.h" #include "desktop.h" #include "mangle.h" @@ -116,9 +114,6 @@ static int iconopen(struct vol *vol, u_char creator[ 4 ], int flags, int mode) int afp_addicon(AFPObj *obj, char *ibuf, size_t ibuflen _U_, char *rbuf, size_t *rbuflen) { struct vol *vol; -#ifndef NO_DDP - struct iovec iov[ 2 ]; -#endif u_char fcreator[ 4 ], imh[ 12 ], irh[ 12 ], *p; int itype, cc = AFP_OK, iovcnt = 0; size_t buflen; @@ -217,44 +212,6 @@ addicon_err: } switch (obj->proto) { -#ifndef NO_DDP - case AFPPROTO_ASP: - buflen = bsize; - if ((asp_wrtcont(obj->handle, rbuf, &buflen) < 0) || buflen != bsize) - return( AFPERR_PARAM ); - -#ifdef DEBUG1 - if (obj->options.flags & OPTION_DEBUG) { - printf("(write) len: %d\n", buflen); - bprint(rbuf, buflen); - } -#endif - - /* - * We're at the end of the file, add the headers, etc. */ - if ( cc == 0 ) { - iov[ 0 ].iov_base = (caddr_t)imh; - iov[ 0 ].iov_len = sizeof( imh ); - iov[ 1 ].iov_base = rbuf; - iov[ 1 ].iov_len = bsize; - iovcnt = 2; - } - - /* - * We found an icon to replace. - */ - if ( cc > 0 ) { - iov[ 0 ].iov_base = rbuf; - iov[ 0 ].iov_len = bsize; - iovcnt = 1; - } - - if ( writev( si.sdt_fd, iov, iovcnt ) < 0 ) { - LOG(log_error, logtype_afpd, "afp_addicon(%s): writev: %s", icon_dtfile(vol, fcreator), strerror(errno) ); - return( AFPERR_PARAM ); - } - break; -#endif /* no afp/asp */ case AFPPROTO_DSI: { DSI *dsi = obj->handle; @@ -712,8 +669,7 @@ static int ad_addcomment(struct vol *vol, struct path *path, char *ibuf) memcpy( ad_entry( adp, ADEID_COMMENT ), ibuf, clen ); ad_flush( adp ); } - if (adp == &ad) - ad_close_metadata( adp); + ad_close_metadata( adp); return( AFP_OK ); }