Exemple #1
0
static void write_line(const char *line)
{
	if (write_all(sock, line, strlen(line)) == -1)
		die_errno("write");

	read_answer();
}
Exemple #2
0
int main(int argc, char *argv[]) 
{
	int sock;
	int ret;
	struct afp_volume volume;
	thisbin=argv[0];

	uid=((unsigned int) geteuid());

	volume.server=NULL;

	if (strstr(argv[0],"mount_afp")) {
		if (handle_mount_afp(argc,argv)<0)
		return -1;
	}
	else if (prepare_buffer(argc,argv)<0)
		return -1;

	if ((sock=daemon_connect()) < 0) 
		return -1;

	send_command(sock,outgoing_buffer,outgoing_len);


	ret=read_answer(sock);
	return ret;
}