Re: [PATCH 36/38] vfs: Add a sample program for the new mount API [ver #10]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi!

> Add a sample program to demonstrate fsopen/fsmount/move_mount to mount
> something.

> @@ -0,0 +1,118 @@
> +/* fd-based mount test.
> + *
> + * Copyright (C) 2017 Red Hat, Inc. All Rights Reserved.
> + * Written by David Howells (dhowells@xxxxxxxxxx)
> + *
> + * This program is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU General Public Licence
> + * as published by the Free Software Foundation; either version
> + * 2 of the Licence, or (at your option) any later version.
> + */

Can we do SPDX here?

> +static void check_messages(int fd)
> +{
> +	char buf[4096];
> +	int err, n;
> +
> +	err = errno;
> +
> +	for (;;) {
> +		n = read(fd, buf, sizeof(buf));
> +		if (n < 0)
> +			break;
> +		n -= 2;
> +
> +		switch (buf[0]) {
> +		case 'e':
> +			fprintf(stderr, "Error: %*.*s\n", n, n, buf + 2);
> +			break;
> +		case 'w':
> +			fprintf(stderr, "Warning: %*.*s\n", n, n, buf + 2);
> +			break;
> +		case 'i':
> +			fprintf(stderr, "Info: %*.*s\n", n, n, buf + 2);
> +			break;
> +		}
> +	}

Hmm, so kernel now returns messages in english? Not sure that is
reasonable, as that is going to cause problems with translations...

									Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

Attachment: signature.asc
Description: Digital signature


[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux